/* public/css/pages/auth.css */
/* Premium Auth Page — Step Flow */

/* ===== ФОНОВА СЦЕНА ===== */
body.auth-page {
    font-family: var(--font-family-sans);
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    background: #0a0e1a;
}

.auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
}

.auth-bg-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: brightness(0.35) saturate(0.7);
}

.auth-bg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(10, 14, 26, 0.85) 0%, rgba(37, 99, 235, 0.15) 50%, rgba(10, 14, 26, 0.9) 100%);
}

.auth-bg-grain {
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

/* ===== LAYOUT ===== */
.auth-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: stretch;
}

/* ===== HERO (ліва частина — десктоп) ===== */
.auth-hero {
    display: none;
}

/* ===== ФОРМА (права частина) ===== */
.auth-form-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-6);
    min-height: 100vh;
    min-height: 100dvh;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.97);
    border-radius: var(--border-radius-2xl);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
    padding: var(--spacing-10);
    animation: cardEnter 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-6);
}

/* Лого */
.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-3);
}

.auth-logo img {
    height: 48px;
    width: auto;
}

.auth-logo-text {
    text-align: left;
    line-height: 1;
}

.auth-logo-name {
    display: block;
    font-size: var(--font-size-2xl);
    font-weight: 900;
    letter-spacing: -0.04em;
    color: var(--color-primary);
}

.auth-logo-sub {
    font-size: 9px;
    font-weight: 800;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

/* Привітання */
.auth-heading {
    text-align: center;
}

.auth-heading h1 {
    font-size: var(--font-size-xl);
    font-weight: 900;
    color: var(--color-text-primary);
    margin: 0 0 var(--spacing-1) 0;
}

.auth-heading p {
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
    margin: 0;
}

/* ===== TELEGRAM БЛОК ===== */
.auth-telegram-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-3);
    padding: var(--spacing-5);
    background: var(--color-bg-light);
    border-radius: var(--border-radius-xl);
    border: 1px solid var(--border-color-light);
}

.auth-telegram-widget {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 40px;
}

/* Кнопка "Змінити акаунт" */
.auth-switch-account {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text-light);
    text-decoration: none;
    transition: all 0.25s ease;
    cursor: pointer;
    padding: 6px 14px;
    border-radius: var(--border-radius-full);
    background: transparent;
    border: 1px solid transparent;
}

.auth-switch-account:hover {
    color: var(--color-primary);
    background: rgba(37, 99, 235, 0.06);
    border-color: rgba(37, 99, 235, 0.15);
}

.auth-switch-icon {
    font-size: 14px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-switch-icon--white {
    font-size: 16px;
}

.auth-switch-account:hover .auth-switch-icon {
    transform: rotate(180deg);
}

.auth-switch-reload-btn:hover .auth-switch-icon {
    transform: rotate(180deg);
}

/* Панель інструкцій */
.auth-switch-panel {
    text-align: left;
    padding: var(--spacing-2) var(--spacing-2);
    animation: fadeInUp 0.3s ease-out;
    width: 100%;
}

.auth-switch-title {
    font-size: var(--font-size-sm);
    font-weight: 800;
    color: var(--color-text-primary);
    margin: 0 0 var(--spacing-3) 0;
    text-align: center;
}

.auth-switch-steps {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    line-height: var(--line-height-relaxed);
    margin: 0 0 var(--spacing-4) 0;
    padding-left: var(--spacing-5);
    list-style: decimal;
}

.auth-switch-steps li {
    margin-bottom: var(--spacing-2);
}

.auth-switch-steps strong {
    color: var(--color-text-primary);
}

.auth-switch-reload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-2);
    width: 100%;
    padding: var(--spacing-3) var(--spacing-4);
    background: linear-gradient(135deg, #2AABEE 0%, #229ED9 100%);
    color: #fff;
    font-family: inherit;
    font-size: var(--font-size-sm);
    font-weight: 700;
    border: none;
    border-radius: var(--border-radius-xl);
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 3px 10px rgba(42, 171, 238, 0.3);
}

.auth-switch-reload-btn:hover {
    background: linear-gradient(135deg, #229ED9 0%, #1E8BC3 100%);
    box-shadow: 0 4px 16px rgba(42, 171, 238, 0.4);
    transform: translateY(-1px);
}

.auth-switch-reload-btn:active {
    transform: translateY(0) scale(0.98);
}

.auth-switch-cancel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: var(--spacing-3);
    font-size: var(--font-size-xs);
    color: var(--color-text-light);
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-switch-cancel:hover {
    color: var(--color-text-primary);
}

/* ===== СТАТИСТИКА (мобільна) ===== */
.auth-stats-mobile {
    display: block;
}

.auth-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-3);
}

.auth-stat-item {
    padding: var(--spacing-4);
    border-radius: var(--border-radius-xl);
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.auth-stat-item--primary {
    background: rgba(37, 99, 235, 0.05);
}

.auth-stat-item--secondary {
    background: rgba(245, 158, 11, 0.05);
}

.auth-stat-value {
    display: block;
    font-size: var(--font-size-2xl);
    font-weight: 900;
}

.auth-stat-item--primary .auth-stat-value {
    color: var(--color-primary);
}

.auth-stat-item--secondary .auth-stat-value {
    color: var(--color-warning);
}

.auth-stat-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== КНОПКА "ЩО Я ТУТ ЗНАЙДУ?" ===== */
.auth-info-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    width: 100%;
    padding: var(--spacing-4) var(--spacing-5);
    background: #fff;
    color: var(--color-text-primary);
    font-weight: 700;
    font-size: var(--font-size-sm);
    border: 1px solid var(--border-color-light);
    border-radius: var(--border-radius-xl);
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
    text-align: left;
}

.auth-info-btn-icon {
    font-size: 22px;
    color: var(--color-warning);
    flex-shrink: 0;
}

.auth-info-btn-arrow {
    margin-left: auto;
    font-size: 16px;
    color: var(--color-text-light);
    transition: transform 0.25s ease;
}

.auth-info-btn:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

.auth-info-btn:hover .auth-info-btn-arrow {
    transform: translateX(3px);
    color: var(--color-primary);
}

.auth-info-btn:active {
    transform: scale(0.98);
}

/* ===== ЗОЛОТИЙ ЗЛИТОК (КНОПКА) ===== */
.auth-info-btn.gold-ingot-btn {
    background: linear-gradient(135deg, #F9D423 0%, #FF4E50 100%);
    background: linear-gradient(135deg, #FFDF00 0%, #D4AF37 40%, #FFF8DC 50%, #D4AF37 60%, #FFDF00 100%);
    background-size: 200% 200%;
    color: #4A3A00;
    border: 1px solid #B8860B;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    animation: goldShimmer 3s infinite linear;
}

@keyframes goldShimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.auth-info-btn.gold-ingot-btn:hover {
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.6);
    border-color: #DAA520;
    transform: translateY(-2px);
}

.auth-info-btn.gold-ingot-btn:active {
    transform: scale(0.98) translateY(0);
}

.auth-info-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.auth-info-title {
    font-weight: 800;
    font-size: var(--font-size-md);
    color: #4A3A00;
    text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.6);
}

.auth-info-subtitle {
    font-size: 11px;
    font-weight: 600;
    color: #6B5500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-info-btn.gold-ingot-btn .auth-info-btn-icon {
    color: #4A3A00;
    font-size: 28px;
    filter: drop-shadow(0px 1px 1px rgba(255,255,255,0.6));
}

.auth-info-btn.gold-ingot-btn .auth-info-btn-arrow {
    color: #4A3A00;
}

.auth-info-btn.gold-ingot-btn:hover .auth-info-btn-arrow {
    transform: translateX(4px);
    color: #4A3A00;
}

/* ===== FOOTER LINKS ===== */
.auth-footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-3);
    padding-top: var(--spacing-2);
}

.auth-footer-links a {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-light);
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-footer-links a:hover {
    color: var(--color-primary);
}

.auth-footer-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--color-text-light);
    opacity: 0.5;
}

/* ===== МОДАЛЬНЕ ВІКНО ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-4);
    z-index: var(--z-index-modal);
}

.modal-overlay.is-open {
    display: flex;
}

.modal-panel {
    background: #fff;
    width: 100%;
    max-width: var(--max-width-2xl);
    max-height: 90vh;
    border-radius: var(--border-radius-2xl);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-4) var(--spacing-6);
    border-bottom: 1px solid var(--border-color-light);
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 20;
    flex-shrink: 0;
}

.modal-header-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
}

.modal-header-icon {
    width: 32px;
    height: 32px;
    background: var(--color-primary);
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-header-icon img {
    height: 20px;
    width: auto;
    filter: brightness(0) invert(1);
}

.modal-header-title {
    font-weight: 800;
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-text-light);
}

.modal-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--color-bg-light);
    border: none;
    border-radius: var(--border-radius-full);
    cursor: pointer;
    color: var(--color-text-light);
    transition: all var(--transition-base);
    font-family: inherit;
    font-size: 20px;
}

.modal-close-btn:hover {
    background: var(--color-bg-medium-gray);
    color: var(--color-text-primary);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: var(--spacing-8);
}

.modal-hero {
    padding: var(--spacing-8) var(--spacing-6);
    text-align: left;
}

.modal-hero h2 {
    font-size: var(--font-size-3xl);
    font-weight: 900;
    color: var(--color-text-primary);
    margin: 0 0 var(--spacing-4) 0;
    line-height: var(--line-height-tight);
}

.modal-hero p {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
    margin: 0;
    max-width: 480px;
}

/* ===== РОЛІ (МОДАЛКА) ===== */
.role-sections {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-4);
    padding: 0 var(--spacing-4);
}

.role-card {
    border-radius: var(--border-radius-2xl);
    padding: var(--spacing-6);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-5);
    border: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.role-card--students { background: rgba(37, 99, 235, 0.04); border-color: rgba(37, 99, 235, 0.08); }
.role-card--teachers { background: rgba(16, 163, 127, 0.04); border-color: rgba(16, 163, 127, 0.08); }
.role-card--organizers { background: rgba(245, 158, 11, 0.04); border-color: rgba(245, 158, 11, 0.08); }
.role-card--djs { background: rgba(179, 0, 255, 0.04); border-color: rgba(179, 0, 255, 0.08); }

.role-card-image {
    width: 140px;
    height: 140px;
    border-radius: var(--border-radius-xl);
    object-fit: cover;
    flex-shrink: 0;
}

.role-card-content {
    flex: 1;
    text-align: left;
}

.role-card-content h3 {
    font-size: var(--font-size-lg);
    font-weight: 900;
    margin: 0 0 var(--spacing-4) 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

.role-card-title-icon {
    font-size: 22px;
}

.role-card--students h3 { color: #1e3a5f; }
.role-card--students .role-card-title-icon { color: var(--color-primary); }
.role-card--teachers h3 { color: #064e3b; }
.role-card--teachers .role-card-title-icon { color: #10a37f; }
.role-card--organizers h3 { color: #78350f; }
.role-card--organizers .role-card-title-icon { color: var(--color-warning); }
.role-card--djs h3 { color: #3d005e; }
.role-card--djs .role-card-title-icon { color: #b300ff; }

.role-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-4);
}

.role-feature {
    font-size: var(--font-size-sm);
    line-height: var(--line-height-relaxed);
}

.role-feature-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.role-feature-header i {
    font-size: 16px;
    flex-shrink: 0;
}

.role-card--students .role-feature { color: rgba(30, 58, 95, 0.8); }
.role-card--students .role-feature-header i { color: var(--color-primary); }
.role-card--students .role-feature b { color: #1e3a5f; }

.role-card--teachers .role-feature { color: rgba(6, 78, 59, 0.8); }
.role-card--teachers .role-feature-header i { color: #10a37f; }
.role-card--teachers .role-feature b { color: #064e3b; }

.role-card--organizers .role-feature { color: rgba(120, 53, 15, 0.8); }
.role-card--organizers .role-feature-header i { color: var(--color-warning); }
.role-card--organizers .role-feature b { color: #78350f; }

.role-card--djs .role-feature { color: rgba(61, 0, 94, 0.8); }
.role-card--djs .role-feature-header i { color: #b300ff; }
.role-card--djs .role-feature b { color: #3d005e; }

.role-feature b {
    font-weight: 700;
}

/* CTA внизу модалки */
.modal-footer {
    padding: var(--spacing-6);
    text-align: center;
    border-top: 1px solid var(--border-color-light);
}

.modal-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-2);
    width: 100%;
    padding: var(--spacing-4) var(--spacing-8);
    background: var(--color-text-primary);
    color: #fff;
    font-weight: 800;
    font-size: var(--font-size-sm);
    border: none;
    border-radius: var(--border-radius-xl);
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: var(--shadow-lg);
    font-family: inherit;
}

.modal-cta-btn:hover {
    background: #000;
    transform: translateY(-1px);
    box-shadow: var(--shadow-xl);
}

.modal-cta-btn:active {
    transform: scale(0.97);
}

/* ===== АНІМАЦІЇ ===== */
@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-enter {
    animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.modal-exit {
    animation: modalSlideOut 0.3s cubic-bezier(0.55, 0.085, 0.68, 0.53) both;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes modalSlideOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(30px) scale(0.96); }
}

/* ===== МОБІЛЬНА АДАПТАЦІЯ ===== */
@media (max-width: 640px) {
    .auth-form-side {
        padding: 0;
    }

    .auth-card {
        max-width: 100%;
        border-radius: 0;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.98);
        min-height: 100dvh;
        justify-content: center;
        padding: var(--spacing-8) var(--spacing-6);
    }

    .auth-logo {
        justify-content: flex-start;
    }

    .auth-heading {
        text-align: left;
    }

    .modal-overlay { padding: 0; }
    .modal-panel {
        max-width: 100%;
        max-height: 100dvh;
        height: 100dvh;
        border-radius: 0;
    }

    .modal-hero {
        padding: var(--spacing-6) var(--spacing-5);
    }

    .modal-hero h2 {
        font-size: var(--font-size-2xl);
    }

    .role-sections { padding: 0 var(--spacing-3); }
    .role-card { padding: var(--spacing-5); gap: var(--spacing-4); }
    .role-card-image { width: 120px; height: 120px; }
    .modal-footer { padding: var(--spacing-6) var(--spacing-5); }
    .modal-cta-btn { width: 100%; }
}

/* ===== ДЕСКТОП (641px+) ===== */
@media (min-width: 641px) {
    .role-card {
        flex-direction: row;
        align-items: flex-start;
        padding: var(--spacing-8);
    }

    .role-card--teachers,
    .role-card--djs {
        flex-direction: row-reverse;
    }

    .modal-hero {
        text-align: center;
        padding: var(--spacing-10) var(--spacing-8);
    }

    .modal-hero p {
        margin: 0 auto;
    }

    .role-sections {
        padding: 0 var(--spacing-6);
    }

    .modal-cta-btn {
        width: auto;
    }
}

/* ===== ВЕЛИКИЙ ДЕСКТОП (960px+) — ДВОКОЛОНКОВИЙ LAYOUT ===== */
@media (min-width: 960px) {
    .auth-wrapper {
        flex-direction: row;
    }

    .auth-hero {
        display: flex;
        flex: 1;
        align-items: center;
        justify-content: center;
        padding: var(--spacing-12);
        position: relative;
    }

    .auth-hero-content {
        max-width: 480px;
        animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
    }

    .auth-hero-badge {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: var(--border-radius-full);
        padding: 6px 16px;
        margin-bottom: var(--spacing-8);
        backdrop-filter: blur(10px);
    }

    .auth-hero-badge i {
        color: var(--color-secondary);
        font-size: 14px;
    }

    .auth-hero-badge span {
        font-size: 11px;
        font-weight: 700;
        color: rgba(255, 255, 255, 0.7);
        text-transform: uppercase;
        letter-spacing: 0.15em;
    }

    .auth-hero-title {
        font-size: 3rem;
        font-weight: 900;
        color: #fff;
        line-height: 1.1;
        letter-spacing: -0.03em;
        margin: 0 0 var(--spacing-6) 0;
    }

    .auth-hero-accent {
        background: linear-gradient(135deg, #60a5fa, #a78bfa);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    .auth-hero-desc {
        font-size: var(--font-size-base);
        color: rgba(255, 255, 255, 0.55);
        line-height: var(--line-height-relaxed);
        margin: 0 0 var(--spacing-10) 0;
        max-width: 380px;
    }

    .auth-hero-stats {
        display: flex;
        align-items: center;
        gap: var(--spacing-8);
    }

    .auth-hero-stat-value {
        display: block;
        font-size: 2.5rem;
        font-weight: 900;
        color: #fff;
        letter-spacing: -0.02em;
    }

    .auth-hero-stat-label {
        font-size: 11px;
        font-weight: 700;
        color: rgba(255, 255, 255, 0.4);
        text-transform: uppercase;
        letter-spacing: 0.12em;
    }

    .auth-hero-stat-divider {
        width: 1px;
        height: 48px;
        background: rgba(255, 255, 255, 0.12);
    }

    .auth-form-side {
        flex: 0 0 480px;
        max-width: 480px;
    }

    .auth-stats-mobile {
        display: none;
    }

    .auth-card {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
}

@media (min-width: 1200px) {
    .auth-hero-title {
        font-size: 3.5rem;
    }

    .auth-form-side {
        flex: 0 0 520px;
        max-width: 520px;
    }
}