/**
 * =============================================
 * AUTHENTICATION PAGE STYLES
 * =============================================
 *
 * Premium login page styling with dark/light theme support.
 * Uses CSS variables from variables.css for theming.
 */

/* =============================================
   BASE STYLES
   ============================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    transition: background var(--transition-medium);
}

/* Background gradient overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-overlay);
    pointer-events: none;
    z-index: 0;
}

/* Animated background particles */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(210, 185, 118, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(210, 185, 118, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(210, 185, 118, 0.05) 0%, transparent 30%);
    pointer-events: none;
    z-index: 0;
    animation: backgroundPulse 8s ease-in-out infinite;
}

@keyframes backgroundPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* =============================================
   THEME TOGGLE BUTTON
   ============================================= */
.theme-toggle {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 1000;
    background: var(--btn-primary-bg);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(210, 185, 118, 0.4);
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 30px rgba(210, 185, 118, 0.5);
}

.theme-toggle i {
    font-size: 20px;
    color: #000;
    transition: transform var(--transition-fast);
}

/* =============================================
   AUTH WRAPPER
   ============================================= */
.auth-wrapper {
    width: 100%;
    max-width: 480px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* =============================================
   AUTH CONTAINER (Card)
   ============================================= */
.auth-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 50px 40px;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(210, 185, 118, 0.1);
    transition: all var(--transition-medium);
}

/* Top gold accent line */
.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold-light), var(--gold-dark));
}

/* Subtle glow effect */
.auth-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at top center, rgba(210, 185, 118, 0.05) 0%, transparent 60%);
    pointer-events: none;
}

.auth-container:hover {
    border-color: rgba(210, 185, 118, 0.3);
    box-shadow:
        0 25px 60px -12px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(210, 185, 118, 0.2),
        0 0 40px rgba(210, 185, 118, 0.1);
}

/* =============================================
   LOGO
   ============================================= */
.auth-logo {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.auth-logo img {
    width: 140px;
    height: auto;
    filter: var(--logo-filter);
    transition: transform var(--transition-fast), filter var(--transition-medium);
}

.auth-logo img:hover {
    transform: scale(1.05);
}

/* =============================================
   AUTH HEADER
   ============================================= */
.auth-header {
    text-align: center;
    margin-bottom: 35px;
    position: relative;
    z-index: 1;
}

.auth-header h1 {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
}

/* =============================================
   FORM STYLES
   ============================================= */
.auth-form {
    position: relative;
    z-index: 1;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
    transition: color var(--transition-medium);
}

.form-group label i {
    color: var(--gold);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 16px 20px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    color: var(--input-text);
    font-family: var(--font-family);
    font-size: 15px;
    outline: none;
    transition: all var(--transition-fast);
}

.form-control::placeholder {
    color: var(--input-placeholder);
}

.form-control:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(210, 185, 118, 0.15);
}

.form-control.is-invalid {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
}

/* =============================================
   PASSWORD FIELD
   ============================================= */
.password-wrapper {
    position: relative;
}

.password-wrapper .form-control {
    padding-right: 50px;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    transition: color var(--transition-fast);
}

.password-toggle:hover {
    color: var(--gold);
}

/* =============================================
   ERROR FEEDBACK
   ============================================= */
.invalid-feedback {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #e74c3c;
    font-size: 13px;
    margin-top: 8px;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* =============================================
   REMEMBER ME CHECKBOX
   ============================================= */
.remember-group {
    margin-bottom: 30px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    user-select: none;
}

.remember-me input[type="checkbox"] {
    display: none;
}

.remember-me .checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    position: relative;
    transition: all var(--transition-fast);
}

.remember-me input[type="checkbox"]:checked + .checkmark {
    background: var(--btn-primary-bg);
    border-color: var(--gold);
}

.remember-me .checkmark::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    color: #000;
    font-size: 11px;
    transition: transform var(--transition-fast);
}

.remember-me input[type="checkbox"]:checked + .checkmark::after {
    transform: translate(-50%, -50%) scale(1);
}

.remember-me:hover .checkmark {
    border-color: var(--gold);
}

/* =============================================
   LOGIN BUTTON
   ============================================= */
.btn-login {
    width: 100%;
    padding: 16px 30px;
    background: var(--btn-primary-bg);
    border: none;
    border-radius: var(--radius-md);
    color: var(--btn-primary-text);
    font-family: var(--font-family);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-fast);
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(210, 185, 118, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login i {
    transition: transform var(--transition-fast);
}

.btn-login:hover i {
    transform: translateX(5px);
}

/* =============================================
   DECORATIVE ELEMENTS
   ============================================= */
.auth-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.decoration-circle {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(210, 185, 118, 0.1);
}

.circle-1 {
    width: 300px;
    height: 300px;
    top: -150px;
    right: -100px;
    animation: float 6s ease-in-out infinite;
}

.circle-2 {
    width: 200px;
    height: 200px;
    bottom: -100px;
    left: -80px;
    animation: float 8s ease-in-out infinite reverse;
}

.circle-3 {
    width: 100px;
    height: 100px;
    top: 50%;
    right: -50px;
    animation: float 5s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

/* =============================================
   RESPONSIVE STYLES
   ============================================= */
@media (max-width: 540px) {
    .auth-wrapper {
        padding: 15px;
    }

    .auth-container {
        padding: 40px 25px;
    }

    .auth-header h1 {
        font-size: 24px;
    }

    .theme-toggle {
        top: 15px;
        right: 15px;
        width: 44px;
        height: 44px;
    }

    .theme-toggle i {
        font-size: 18px;
    }

    .form-control {
        padding: 14px 16px;
        font-size: 14px;
    }

    .btn-login {
        padding: 14px 25px;
        font-size: 15px;
    }
}

@media (max-width: 380px) {
    .auth-container {
        padding: 30px 20px;
    }

    .auth-logo img {
        width: 120px;
    }

    .auth-header h1 {
        font-size: 22px;
    }
}

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}
