:root {
    /* Main brand colors */
    --color-gold: #C6B069;
    --color-gold-darker: #7a6c3e;
    --color-white: #FFFFFF;
    --color-black: #181714;
    --color-cream: #F8F5F0;
    --color-ivory: #FDFDF8;
    
    /* Semantic colors */
    --color-background: var(--color-white);
    --color-primary: var(--color-white);
    --color-accent: var(--color-gold);
    --color-card-bg: var(--color-ivory);
    --color-text-dark: var(--color-black);
    --color-text-light: var(--color-white);
    --color-text-on-dark: var(--color-white);
    
    /* UI colors */
    --color-input-bg: var(--color-white);
    --color-input-focus-bg: var(--color-white);
    --color-error: #DC2626;
    --color-disabled: #6B7280;
    
    /* Shadow colors */
    --shadow-soft: rgba(0, 0, 0, 0.08);
    --shadow-medium: rgba(0, 0, 0, 0.12);
    --shadow-heavy: rgba(0, 0, 0, 0.15);
    --shadow-accent: rgba(198, 176, 105, 0.25);
    --shadow-error: rgba(220, 38, 38, 0.1);
}

/* ===== RESET AND BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--color-background);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    color: var(--color-text-dark);
}

/* ===== PARTICLES CONTAINER ===== */
#particles-js {
    position: relative;
    width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 120px);
    background: var(--color-background);
}

#particles-js canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* ===== MESSAGE STYLES ===== */
.messages-container {
    margin-bottom: 1.5rem;
}

.message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
}

.message.error {
    background-color: #FEF2F2;
    color: #DC2626;
    border-color: #FECACA;
}

.message.success {
    background-color: #F0FDF4;
    color: #16A34A;
    border-color: #BBF7D0;
}

.message.info {
    background-color: #F0F9FF;
    color: #0284C7;
    border-color: #BAE6FD;
}

.message.warning {
    background-color: #FFFBEB;
    color: #D97706;
    border-color: #FDE68A;
}

/* ===== LOGIN CONTAINER ===== */
.login-container {
    position: relative;
    z-index: 20;
    width: 100%;
    max-width: 440px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: var(--color-card-bg);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px var(--shadow-soft),
                0 2px 8px var(--shadow-medium);
    width: 100%;
    color: var(--color-text-dark);
    position: relative;
    z-index: 20;
    border: 5px solid rgba(198, 176, 105, 0.15);
    backdrop-filter: blur(10px);
}

/* ===== LOGIN HEADER ===== */
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    color: var(--color-text-dark);
    font-size: 1.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    letter-spacing: -0.025em;
}

.login-header p {
    color: var(--color-text-dark);
    opacity: 0.7;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
}

/* ===== FORM STYLES ===== */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.input-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
}

.input-wrapper input {
    background: var(--color-input-bg);
    border: 1.5px solid #E5E7EB;
    border-radius: 8px;
    padding: 14px 16px;
    color: var(--color-text-dark);
    font-size: 15px;
    font-weight: 400;
    transition: all 0.2s ease;
    width: 100%;
    outline: none;
}

.input-wrapper input:focus {
    border-color: var(--color-accent);
    background: var(--color-input-focus-bg);
    box-shadow: 0 0 0 3px var(--shadow-accent);
    transform: translateY(-1px);
}

.input-wrapper input:focus + label,
.input-wrapper input:valid + label {
    transform: translateY(-38px) scale(0.85);
    color: var(--color-accent);
    font-weight: 500;
}

.input-wrapper label {
    position: absolute;
    left: 16px;
    top: 14px;
    color: var(--color-text-dark);
    opacity: 0.6;
    font-size: 15px;
    font-weight: 400;
    transition: all 0.2s ease;
    pointer-events: none;
    transform-origin: left top;
    background: transparent;
    padding: 0;
}

/* ===== PASSWORD TOGGLE ===== */
.input-wrapper .password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--color-text-dark);
    opacity: 0.5;
    transition: all 0.2s ease;
    z-index: 2;
}

.input-wrapper .password-toggle:hover {
    color: var(--color-accent);
    opacity: 1;
}

.toggle-icon {
    display: block;
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23181714' stroke-width='1.5'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M15 12a3 3 0 11-6 0 3 3 0 016 0z'/%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z'/%3e%3c/svg%3e");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: background-image 0.2s ease;
}

.password-toggle:hover .toggle-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23C6B069' stroke-width='1.5'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M15 12a3 3 0 11-6 0 3 3 0 016 0z'/%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z'/%3e%3c/svg%3e");
}

.toggle-icon.show-password {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23181714' stroke-width='1.5'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M3.98 8.223A10.477 10.477 0 001.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0112 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 01-4.293 5.774M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 11-4.243-4.243m4.242 4.242L9.88 9.88'/%3e%3c/svg%3e");
}

/* ===== FORM OPTIONS ===== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 12px;
}

.remember-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.remember-wrapper input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #D1D5DB;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    background: transparent;
}

.remember-wrapper input[type="checkbox"]:checked + .checkbox-label .checkmark {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

.remember-wrapper input[type="checkbox"]:checked + .checkbox-label .checkmark::after {
    content: '✓';
    color: var(--color-white);
    font-size: 11px;
    font-weight: bold;
}

.checkbox-label {
    color: var(--color-text-dark);
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.8;
}

.forgot-password {
    color: var(--color-text-dark);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.forgot-password:hover {
    color: var(--color-accent);
    text-decoration: underline;
    opacity: 1;
}

/* ===== LOGIN BUTTON ===== */
.login-btn {
    width: 100%;
    background: var(--color-accent);
    border: none;
    border-radius: 8px;
    padding: 14px 24px;
    color: var(--color-white);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    margin-bottom: 1.5rem;
    letter-spacing: 0.025em;
}

.login-btn:hover {
    background: var(--color-gold-darker);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-accent);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn.loading {
    pointer-events: none;
    background: var(--color-disabled);
}

.btn-text {
    transition: opacity 0.2s ease;
}

.btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    border-top: 2px solid var(--color-white);
    border-radius: 50%;
    opacity: 0;
    animation: spin 1s linear infinite;
    transition: opacity 0.2s ease;
}

.login-btn.loading .btn-text {
    opacity: 0;
}

.login-btn.loading .btn-loader {
    opacity: 1;
}

/* ===== ERROR STATES ===== */
.error-message {
    color: var(--color-error);
    font-size: 13px;
    font-weight: 500;
    margin-top: 6px;
    margin-left: 4px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.error-message.show {
    opacity: 1;
    transform: translateY(0);
}

.form-group.error .input-wrapper input {
    border-color: var(--color-error);
    box-shadow: 0 0 0 3px var(--shadow-error);
}

/* ===== SIGNUP LINK ===== */
.signup-link {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.signup-link p {
    color: var(--color-text-dark);
    font-size: 14px;
    opacity: 0.8;
}

.signup-link a {
    color: var(--color-text-dark);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.signup-link a:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

.inline-link {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.inline-link:hover {
    color: var(--color-gold-darker);
    text-decoration: underline;
}

/* ===== ANIMATIONS ===== */
@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ===== ENHANCED CARD STYLES ===== */
.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
    border-radius: 16px 16px 0 0;
}

.kc-error {
    background: #ffdddd;
    border-left: 4px solid #d8000c;
    padding: 15px;
    margin-bottom: 20px;
    color: #333;
    border-radius: 6px;
}