/*
 * Auth Pages - Sky Theme
 * Inspired by modern cloud-based design with eCartelera green accents
 */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@200..800&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap');

/* -------------------------------------------------------------------------- */
/* Page Layout                                                                  */
/* -------------------------------------------------------------------------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
    overflow: hidden;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* -------------------------------------------------------------------------- */
/* Background with Green Theme                                                  */
/* -------------------------------------------------------------------------- */
.auth-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.auth-bg-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        #e8f5d6 0%,
        #f0f9e4 20%,
        #f5fbef 40%,
        #f9fcf5 60%,
        #ffffff 100%
    );
}

.auth-bg-clouds {
    position: absolute;
    inset: 0;
    background-image:
        /* Cloud 1 - top left */
        radial-gradient(ellipse 300px 100px at 10% 15%, rgba(255, 255, 255, 0.9) 0%, transparent 70%),
        /* Cloud 2 - top right */
        radial-gradient(ellipse 400px 120px at 85% 10%, rgba(255, 255, 255, 0.85) 0%, transparent 70%),
        /* Cloud 3 - middle left */
        radial-gradient(ellipse 250px 80px at 5% 45%, rgba(255, 255, 255, 0.75) 0%, transparent 70%),
        /* Cloud 4 - bottom left */
        radial-gradient(ellipse 500px 150px at 15% 90%, rgba(255, 255, 255, 0.95) 0%, transparent 60%),
        /* Cloud 5 - bottom center */
        radial-gradient(ellipse 600px 180px at 50% 95%, rgba(255, 255, 255, 0.9) 0%, transparent 60%),
        /* Cloud 6 - bottom right */
        radial-gradient(ellipse 450px 140px at 80% 88%, rgba(255, 255, 255, 0.95) 0%, transparent 60%),
        /* Cloud 7 - far right */
        radial-gradient(ellipse 200px 70px at 95% 50%, rgba(255, 255, 255, 0.7) 0%, transparent 70%);
    animation: clouds-drift 60s ease-in-out infinite;
}

@keyframes clouds-drift {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-20px); }
}

/* Arc removed per design request */
.auth-bg-arc {
    display: none;
}

/* -------------------------------------------------------------------------- */
/* Logo Pill (hidden - logo now in card)                                        */
/* -------------------------------------------------------------------------- */
.auth-logo-pill {
    display: none;
}

/* -------------------------------------------------------------------------- */
/* Main Content Area                                                            */
/* -------------------------------------------------------------------------- */
.auth-main {
    width: 100%;
    max-width: 535px;
    z-index: 1;
}

/* -------------------------------------------------------------------------- */
/* Auth Card                                                                    */
/* -------------------------------------------------------------------------- */
.auth-card {
    width: 100%;
    max-width: 535px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.06),
        0 12px 48px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.8);
    text-align: center;
}

/* Logo in card */
.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
}

.auth-logo-box {
    background: #0a0a0a;
    padding: 14px 28px;
    border-radius: 16px;
    display: inline-block;
}

.auth-logo-box img {
    height: 32px;
    width: auto;
    display: block;
}

/* Icon (for pages without logo) */
.auth-icon {
    width: 64px;
    height: 64px;
    background: #f5f7fa;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: #374151;
}

/* Title */
.auth-card h1 {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}

.auth-subtitle {
    font-size: 0.938rem;
    color: #6b7280;
    margin: 0 0 28px;
    line-height: 1.5;
}

/* -------------------------------------------------------------------------- */
/* Alerts                                                                       */
/* -------------------------------------------------------------------------- */
.auth-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.875rem;
    margin-bottom: 20px;
    text-align: left;
}

.auth-alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.auth-alert-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* -------------------------------------------------------------------------- */
/* Input Fields                                                                 */
/* -------------------------------------------------------------------------- */
.auth-input-group {
    position: relative;
    margin-bottom: 16px;
}

.auth-input-group input {
    width: 100%;
    height: 52px;
    padding: 0 16px 0 48px;
    font-size: 0.938rem;
    font-family: inherit;
    color: #111827;
    background: #f3f4f6;
    border: 2px solid transparent;
    border-radius: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.auth-input-group input::placeholder {
    color: #9ca3af;
}

.auth-input-group input:focus {
    background: #ffffff;
    border-color: #9ee800;
    box-shadow: 0 0 0 4px rgba(158, 232, 0, 0.1);
}

.auth-input-group.has-error input {
    border-color: #dc2626;
    background: #fef2f2;
}

.auth-input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
    display: flex;
}

.auth-input-group input:focus + .auth-input-icon,
.auth-input-group input:focus ~ .auth-input-icon {
    color: #9ee800;
}

/* Reorder icon for focus state */
.auth-input-group {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.auth-input-group .auth-input-icon {
    order: -1;
}

.auth-toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.auth-toggle-password:hover {
    color: #6b7280;
}

.auth-field-error {
    display: block;
    font-size: 0.813rem;
    color: #dc2626;
    text-align: left;
    margin-top: -12px;
    margin-bottom: 16px;
    padding-left: 4px;
}

.auth-hint {
    font-size: 0.75rem;
    color: #9ca3af;
    text-align: left;
    margin-top: -8px;
    margin-bottom: 16px;
    padding-left: 4px;
}

/* -------------------------------------------------------------------------- */
/* Options Row (Remember me + Forgot password)                                  */
/* -------------------------------------------------------------------------- */
.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

/* Toggle Switch */
.auth-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.875rem;
    color: #374151;
}

.auth-toggle input {
    display: none;
}

.auth-toggle-track {
    width: 44px;
    height: 24px;
    background: #d1d5db;
    border-radius: 12px;
    position: relative;
    transition: background 0.2s ease;
}

.auth-toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.auth-toggle input:checked + .auth-toggle-track {
    background: #9ee800;
}

.auth-toggle input:checked + .auth-toggle-track::after {
    transform: translateX(20px);
}

.auth-link {
    font-size: 0.875rem;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-link:hover {
    color: #759e0b;
}

/* -------------------------------------------------------------------------- */
/* Buttons                                                                      */
/* -------------------------------------------------------------------------- */
.auth-btn {
    width: 100%;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.938rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.auth-btn-primary {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
    color: #ffffff;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.auth-btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(158, 232, 0, 0.3), transparent);
}

.auth-btn-primary::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(158, 232, 0, 0.5), transparent);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.auth-btn-primary:hover {
    background: linear-gradient(135deg, #222222 0%, #3a3a3a 50%, #222222 100%);
    transform: translateY(-2px);
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.2),
        0 0 20px rgba(158, 232, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.auth-btn-primary:hover::after {
    opacity: 1;
}

.auth-btn-primary:active {
    transform: translateY(0);
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.15),
        inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.auth-btn-secondary {
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    color: #374151;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.auth-btn-secondary:hover {
    background: linear-gradient(180deg, #ffffff 0%, #f3f4f6 100%);
    border-color: #9ee800;
    color: #1a1a1a;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.06),
        0 0 0 3px rgba(158, 232, 0, 0.1);
    transform: translateY(-1px);
}

.auth-btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* -------------------------------------------------------------------------- */
/* Divider                                                                      */
/* -------------------------------------------------------------------------- */
.auth-divider {
    position: relative;
    text-align: center;
    margin: 24px 0;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: repeating-linear-gradient(
        90deg,
        #e5e7eb 0px,
        #e5e7eb 4px,
        transparent 4px,
        transparent 8px
    );
}

.auth-divider span {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    padding: 0 16px;
    font-size: 0.813rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* -------------------------------------------------------------------------- */
/* Dark Mode                                                                    */
/* -------------------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
    .auth-bg-gradient {
        background: linear-gradient(
            180deg,
            #1a2e0a 0%,
            #141f0a 20%,
            #0f1608 40%,
            #0a0d06 60%,
            #050505 100%
        );
    }

    .auth-bg-clouds {
        background-image:
            radial-gradient(ellipse 300px 100px at 10% 15%, rgba(30, 40, 20, 0.5) 0%, transparent 70%),
            radial-gradient(ellipse 400px 120px at 85% 10%, rgba(30, 40, 20, 0.4) 0%, transparent 70%),
            radial-gradient(ellipse 250px 80px at 5% 45%, rgba(30, 40, 20, 0.3) 0%, transparent 70%),
            radial-gradient(ellipse 500px 150px at 15% 90%, rgba(20, 30, 15, 0.6) 0%, transparent 60%),
            radial-gradient(ellipse 600px 180px at 50% 95%, rgba(20, 30, 15, 0.5) 0%, transparent 60%),
            radial-gradient(ellipse 450px 140px at 80% 88%, rgba(20, 30, 15, 0.6) 0%, transparent 60%),
            radial-gradient(ellipse 200px 70px at 95% 50%, rgba(30, 40, 20, 0.3) 0%, transparent 70%);
    }

    .auth-card {
        background: rgba(20, 20, 22, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow:
            0 4px 24px rgba(0, 0, 0, 0.3),
            0 12px 48px rgba(0, 0, 0, 0.4);
    }

    .auth-card h1 {
        color: #f5f5f5;
    }

    .auth-subtitle {
        color: rgba(229, 229, 229, 0.7);
    }

    .auth-icon {
        background: rgba(40, 40, 44, 0.8);
        color: #e5e5e5;
    }

    .auth-alert-error {
        background: rgba(220, 38, 38, 0.15);
        color: #ff6b6b;
        border-color: rgba(220, 38, 38, 0.3);
    }

    .auth-alert-success {
        background: rgba(22, 163, 74, 0.15);
        color: #6ee7b7;
        border-color: rgba(22, 163, 74, 0.3);
    }

    .auth-input-group input {
        background: rgba(30, 30, 34, 0.8);
        border-color: rgba(255, 255, 255, 0.1);
        color: #f5f5f5;
    }

    .auth-input-group input::placeholder {
        color: rgba(229, 229, 229, 0.4);
    }

    .auth-input-group input:focus {
        background: rgba(40, 40, 44, 0.9);
        border-color: #9ee800;
    }

    .auth-input-group.has-error input {
        border-color: #ff6b6b;
        background: rgba(220, 38, 38, 0.1);
    }

    .auth-input-icon {
        color: rgba(229, 229, 229, 0.5);
    }

    .auth-toggle-password {
        color: rgba(229, 229, 229, 0.5);
    }

    .auth-toggle-password:hover {
        color: rgba(229, 229, 229, 0.8);
    }

    .auth-field-error {
        color: #ff6b6b;
    }

    .auth-hint {
        color: rgba(229, 229, 229, 0.5);
    }

    .auth-toggle span:last-child {
        color: rgba(229, 229, 229, 0.8);
    }

    .auth-toggle-track {
        background: rgba(60, 60, 66, 0.8);
    }

    .auth-link {
        color: rgba(229, 229, 229, 0.6);
    }

    .auth-link:hover {
        color: #9ee800;
    }

    .auth-btn-primary {
        background: linear-gradient(135deg, #9ee800 0%, #7bc400 50%, #9ee800 100%);
        color: #050505;
    }

    .auth-btn-primary::before {
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    }

    .auth-btn-primary::after {
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    }

    .auth-btn-primary:hover {
        background: linear-gradient(135deg, #b4ff1a 0%, #8ed600 50%, #b4ff1a 100%);
        box-shadow:
            0 6px 20px rgba(0, 0, 0, 0.3),
            0 0 30px rgba(158, 232, 0, 0.2);
    }

    .auth-btn-secondary {
        background: rgba(30, 30, 34, 0.8);
        color: #e5e5e5;
        border: 1px solid rgba(255, 255, 255, 0.12);
    }

    .auth-btn-secondary:hover {
        background: rgba(40, 40, 44, 0.9);
        border-color: #9ee800;
        color: #f5f5f5;
        box-shadow:
            0 4px 12px rgba(0, 0, 0, 0.2),
            0 0 0 3px rgba(158, 232, 0, 0.15);
    }

    .auth-divider::before {
        background: repeating-linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.15) 0px,
            rgba(255, 255, 255, 0.15) 4px,
            transparent 4px,
            transparent 8px
        );
    }

    .auth-divider span {
        background: rgba(20, 20, 22, 0.95);
        color: rgba(229, 229, 229, 0.5);
    }
}

/* -------------------------------------------------------------------------- */
/* Responsive                                                                   */
/* -------------------------------------------------------------------------- */
@media (max-width: 480px) {
    .auth-page {
        padding: 20px 16px;
    }

    .auth-logo-pill {
        top: 16px;
        left: 16px;
        padding: 8px 16px;
    }

    .auth-logo-pill img {
        height: 24px;
    }

    .auth-card {
        padding: 32px 24px;
        border-radius: 20px;
    }

    .auth-card h1 {
        font-size: 1.5rem;
    }

    .auth-options {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .auth-link {
        align-self: flex-end;
    }

    .auth-bg-arc {
        display: none;
    }
}
