/* ================================================
   ЕГЭ Тренажёр — Main Stylesheet
   Colors: #6C63FF (primary), #FF6584 (accent),
           #43C6AC (green), #1A1A2E (dark), #F4F6FC (bg)
   Fonts: Nunito (headings), Inter (body)
   ================================================ */

:root {
    --primary:        #6C63FF;
    --primary-light:  #9B94FF;
    --primary-dark:   #4A43C9;
    --accent:         #FF6584;
    --accent-light:   #FF8FA3;
    --green:          #43C6AC;
    --orange:         #F7971E;
    --dark:           #1A1A2E;
    --dark-mid:       #2A2A4A;
    --text:           #2D2D44;
    --text-muted:     #7B7B9D;
    --bg:             #F4F6FC;
    --bg-card:        #FFFFFF;
    --border:         #E4E6F0;
    --success:        #43C6AC;
    --error:          #FF6584;
    --radius-sm:      10px;
    --radius:         16px;
    --radius-lg:      24px;
    --shadow-sm:      0 2px 8px rgba(108,99,255,.08);
    --shadow:         0 8px 32px rgba(108,99,255,.14);
    --shadow-lg:      0 16px 48px rgba(108,99,255,.22);
    --transition:     0.22s cubic-bezier(0.4,0,0.2,1);
}

/* =================== RESET =================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
img { max-width: 100%; display: block; }

/* =================== TYPOGRAPHY =================== */
h1, h2, h3, h4, h5 {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    line-height: 1.25;
    color: var(--dark);
}

/* =================== LAYOUT =================== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
}
.main-content {
    padding-bottom: 3rem;
}

/* =================== NAVBAR =================== */
.navbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}
.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
}
.navbar-brand {
    display: flex;
    align-items: center;
    gap: .625rem;
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 1.2rem;
    color: var(--primary);
}
.brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    transition: var(--transition);
}
.navbar-brand:hover .brand-icon {
    transform: rotate(-8deg) scale(1.1);
    box-shadow: 0 4px 16px rgba(108,99,255,.4);
}
.brand-name { color: var(--dark); }
.navbar-right {
    display: flex;
    align-items: center;
    gap: .75rem;
}
.navbar-user {
    font-size: .875rem;
    font-weight: 600;
    color: var(--text-muted);
    display: none;
}
@media (min-width: 480px) { .navbar-user { display: block; } }

/* Profile link in navbar */
.navbar-profile-link {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .3rem .7rem .3rem .3rem;
    border-radius: 24px;
    border: 1.5px solid var(--border);
    background: var(--bg);
    transition: var(--transition);
    cursor: pointer;
}
.navbar-profile-link:hover {
    border-color: var(--primary);
    background: rgba(108,99,255,.06);
}
.navbar-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: .75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.navbar-profile-name {
    font-size: .8rem;
    font-weight: 700;
    color: var(--text);
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: none;
}
@media (min-width: 480px) { .navbar-profile-name { display: block; } }

.btn-logout {
    font-size: .8rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: .375rem .875rem;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    transition: var(--transition);
}
.btn-logout:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* =================== AUTH =================== */
.auth-body { background: var(--bg); }
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}
.auth-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.auth-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .35;
}
.auth-blob-1 {
    width: 500px; height: 500px;
    background: var(--primary);
    top: -200px; left: -150px;
    animation: blobFloat1 8s ease-in-out infinite;
}
.auth-blob-2 {
    width: 400px; height: 400px;
    background: var(--accent);
    bottom: -150px; right: -100px;
    animation: blobFloat2 10s ease-in-out infinite;
}
.auth-blob-3 {
    width: 300px; height: 300px;
    background: var(--green);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation: blobFloat3 12s ease-in-out infinite;
}
@keyframes blobFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%       { transform: translate(40px, 30px) scale(1.08); }
}
@keyframes blobFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%       { transform: translate(-30px, -40px) scale(1.06); }
}
@keyframes blobFloat3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    33%       { transform: translate(-45%, -55%) scale(1.1); }
    66%       { transform: translate(-55%, -45%) scale(0.95); }
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
    animation: cardSlideUp .5s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes cardSlideUp {
    from { opacity: 0; transform: translateY(40px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@media (min-width: 480px) {
    .auth-card { padding: 3rem 2.5rem; }
}
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo-icon {
    width: 64px; height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 1.4rem;
    margin-bottom: .875rem;
    box-shadow: 0 8px 24px rgba(108,99,255,.3);
    animation: iconBounce .6s .3s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes iconBounce {
    from { opacity: 0; transform: scale(.5) rotate(-10deg); }
    to   { opacity: 1; transform: scale(1) rotate(0deg); }
}
.auth-logo-title {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--dark);
    margin-bottom: .25rem;
}
.auth-logo-sub {
    font-size: .875rem;
    color: var(--text-muted);
}

/* Form */
.auth-form { display: flex; flex-direction: column; gap: 1.125rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 380px) { .form-row { grid-template-columns: 1fr; } }
.form-group { display: flex; flex-direction: column; gap: .375rem; }
.form-label {
    font-size: .8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.form-input {
    padding: .75rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .95rem;
    font-family: 'Inter', sans-serif;
    color: var(--text);
    background: var(--bg);
    transition: var(--transition);
    outline: none;
    width: 100%;
}
.form-input:focus {
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(108,99,255,.12);
}
.input-password-wrapper { position: relative; }
.input-password-wrapper .form-input { padding-right: 2.75rem; }
.toggle-password {
    position: absolute;
    right: .75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    padding: .25rem;
    transition: var(--transition);
}
.toggle-password svg { width: 18px; height: 18px; display: block; }
.toggle-password:hover { color: var(--primary); }

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .875rem 1.75rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 1rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(108,99,255,.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(108,99,255,.4);
}
.btn-primary:active { transform: translateY(0) scale(.98); }
.btn-full { width: 100%; }

.alert {
    padding: .75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    font-weight: 600;
    margin-bottom: .5rem;
}
.alert-error {
    background: rgba(255,101,132,.1);
    color: var(--accent);
    border: 1.5px solid rgba(255,101,132,.25);
    animation: alertShake .4s ease;
}
@keyframes alertShake {
    0%, 100% { transform: translateX(0); }
    25%       { transform: translateX(-6px); }
    75%       { transform: translateX(6px); }
}
.auth-link-text {
    text-align: center;
    margin-top: 1.25rem;
    font-size: .875rem;
    color: var(--text-muted);
}
.auth-link {
    color: var(--primary);
    font-weight: 700;
}
.auth-link:hover { text-decoration: underline; }

/* =================== SECTION / PAGE STRUCTURE =================== */
.section { padding: 2.5rem 0; }
.section--features { padding-top: 0; }
.section-header { text-align: center; margin-bottom: 2rem; }
.section-title {
    font-size: 1.875rem;
    font-weight: 900;
    color: var(--dark);
    margin-bottom: .5rem;
}
.section-subtitle { font-size: .95rem; color: var(--text-muted); }

.page-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 0 1rem;
}
.page-title {
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--dark);
    margin-top: .375rem;
}
.page-subtitle {
    font-size: .9rem;
    color: var(--text-muted);
    margin-top: .25rem;
}

/* Back link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    font-size: .875rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: var(--transition);
}
.back-link svg { width: 16px; height: 16px; }
.back-link:hover { color: var(--primary); }

/* =================== HERO =================== */
.hero {
    padding: 3rem 0 2.5rem;
    position: relative;
    overflow: hidden;
}
.hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.hero-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: .22;
}
.hero-blob-1 {
    width: 500px; height: 500px;
    background: var(--primary);
    top: -200px; right: -100px;
    animation: blobFloat1 12s ease-in-out infinite;
}
.hero-blob-2 {
    width: 300px; height: 300px;
    background: var(--accent);
    bottom: -100px; left: -50px;
    animation: blobFloat2 15s ease-in-out infinite;
}
.hero-inner {
    position: relative;
    animation: fadeInUp .6s .1s both;
}
.hero-badge {
    display: inline-block;
    background: rgba(108,99,255,.12);
    color: var(--primary);
    font-weight: 700;
    font-size: .78rem;
    padding: .3rem .875rem;
    border-radius: 20px;
    margin-bottom: 1rem;
    letter-spacing: .05em;
    text-transform: uppercase;
    border: 1px solid rgba(108,99,255,.2);
}
.hero-title {
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 900;
    color: var(--dark);
    margin-bottom: .75rem;
}
.hero-name {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 480px;
    margin-bottom: 1.5rem;
}
.hero-status {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-size: .85rem;
    color: var(--text-muted);
    font-weight: 600;
}
.status-dot {
    width: 8px; height: 8px;
    background: var(--green);
    border-radius: 50%;
    animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(67,198,172,.5); }
    50%       { box-shadow: 0 0 0 6px rgba(67,198,172,0); }
}

/* =================== GLOBAL ANIMATIONS =================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(.9); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Staggered children animation */
.stagger-children > * {
    animation: fadeInUp .5s both;
}
.stagger-children > *:nth-child(1) { animation-delay: .05s; }
.stagger-children > *:nth-child(2) { animation-delay: .12s; }
.stagger-children > *:nth-child(3) { animation-delay: .19s; }
.stagger-children > *:nth-child(4) { animation-delay: .26s; }
.stagger-children > *:nth-child(5) { animation-delay: .33s; }
.stagger-children > *:nth-child(6) { animation-delay: .40s; }

/* =================== EXAM CARDS =================== */
.exam-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}
@media (min-width: 520px) { .exam-grid { grid-template-columns: 1fr 1fr; } }

.exam-card {
    position: relative;
    border-radius: var(--radius-lg);
    padding: 2rem 1.75rem;
    overflow: hidden;
    transition: transform .25s cubic-bezier(0.34,1.56,0.64,1), box-shadow .25s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    text-decoration: none;
    min-height: 200px;
    animation: scaleIn .5s both;
}
.exam-card:nth-child(2) { animation-delay: .1s; }
.exam-card:not(.exam-card--soon):hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: var(--shadow-lg);
}
.exam-card--ege {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
}
.exam-card--oge {
    background: linear-gradient(135deg, var(--orange) 0%, #e07b00 100%);
    color: #fff;
}
.exam-card--soon { opacity: .75; cursor: default; }
.exam-card-glow {
    position: absolute;
    width: 200px; height: 200px;
    background: rgba(255,255,255,.12);
    border-radius: 50%;
    top: -80px; right: -60px;
    pointer-events: none;
    transition: var(--transition);
}
.exam-card:hover .exam-card-glow {
    transform: scale(1.4);
    opacity: .2;
}
.exam-card-icon {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 1.1rem;
    opacity: .7;
    letter-spacing: .04em;
}
.exam-card-title {
    font-size: 2.2rem;
    font-weight: 900;
    color: #fff;
    margin-top: auto;
}
.exam-card-desc { font-size: .9rem; opacity: .8; }
.exam-card-badge {
    display: inline-block;
    background: rgba(255,255,255,.2);
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    padding: .25rem .75rem;
    border-radius: 20px;
    width: fit-content;
}
.exam-card-badge--soon { background: rgba(0,0,0,.15); }
.exam-card-arrow {
    width: 20px; height: 20px;
    margin-top: auto;
    opacity: .7;
    stroke: #fff;
    transition: var(--transition);
}
.exam-card:not(.exam-card--soon):hover .exam-card-arrow {
    transform: translateX(6px);
    opacity: 1;
}

/* =================== FEATURES =================== */
.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 520px) { .features-grid { grid-template-columns: repeat(3, 1fr); } }

.feature-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
    animation: fadeInUp .5s both;
}
.feature-card:nth-child(1) { animation-delay: .1s; }
.feature-card:nth-child(2) { animation-delay: .2s; }
.feature-card:nth-child(3) { animation-delay: .3s; }
.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: rgba(108,99,255,.2);
}
.feature-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    transition: var(--transition);
}
.feature-card:hover .feature-icon { transform: scale(1.12) rotate(-5deg); }
.feature-icon svg { width: 22px; height: 22px; }
.feature-icon--purple { background: rgba(108,99,255,.12); color: var(--primary); }
.feature-icon--orange { background: rgba(247,151,30,.12); color: var(--orange); }
.feature-icon--green  { background: rgba(67,198,172,.12); color: var(--green); }
.feature-title { font-size: 1rem; font-weight: 800; margin-bottom: .375rem; }
.feature-desc { font-size: .875rem; color: var(--text-muted); line-height: 1.5; }

/* =================== SUBJECT CARDS =================== */
.subject-grid {
    display: flex;
    flex-direction: column;
    gap: .875rem;
}
.subject-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    transition: var(--transition);
    overflow: hidden;
    animation: fadeInUp .4s both;
}
.subject-card:nth-child(1) { animation-delay: .05s; }
.subject-card:nth-child(2) { animation-delay: .12s; }
.subject-card:nth-child(3) { animation-delay: .19s; }
.subject-card:not(.subject-card--soon):hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateX(4px);
}
.subject-card--soon { opacity: .65; cursor: default; }
.subject-card-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
}
.subject-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: .875rem;
    flex-shrink: 0;
    color: #fff;
    transition: var(--transition);
}
.subject-card:not(.subject-card--soon):hover .subject-icon {
    transform: scale(1.1) rotate(-6deg);
}
.subject-icon--russian { background: linear-gradient(135deg, var(--primary), var(--accent)); }
.subject-icon--math    { background: linear-gradient(135deg, var(--orange), #e05f00); }
.subject-icon--history { background: linear-gradient(135deg, #8B5CF6, #6D28D9); }
.subject-icon--english { background: linear-gradient(135deg, var(--green), #2aa88a); }
.subject-info { flex: 1; }
.subject-title { font-size: 1rem; font-weight: 800; color: var(--dark); }
.subject-desc { font-size: .8rem; color: var(--text-muted); margin-top: .15rem; }
.subject-arrow {
    width: 18px; height: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: var(--transition);
}
.subject-card:not(.subject-card--soon):hover .subject-arrow {
    color: var(--primary);
    transform: translateX(4px);
}
.badge-soon {
    font-size: .72rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--border);
    padding: .2rem .6rem;
    border-radius: 20px;
}

/* =================== TRAINER CATALOG CARDS =================== */
.trainer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}
@media (min-width: 600px) { .trainer-grid { grid-template-columns: 1fr 1fr; } }

.trainer-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--border);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
    transition: var(--transition);
    cursor: pointer;
    animation: scaleIn .4s both;
    position: relative;
    overflow: hidden;
}
.trainer-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(108,99,255,.04), rgba(255,101,132,.04));
    opacity: 0;
    transition: var(--transition);
}
.trainer-card:not(.trainer-card--soon):hover::before { opacity: 1; }
.trainer-card:not(.trainer-card--soon):hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-5px);
}
.trainer-card--soon { opacity: .65; cursor: default; }
.trainer-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}
.trainer-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.trainer-card:not(.trainer-card--soon):hover .trainer-icon {
    transform: scale(1.12) rotate(-8deg);
}
.trainer-icon svg { width: 24px; height: 24px; }
.trainer-icon--accent {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    box-shadow: 0 4px 16px rgba(108,99,255,.3);
}
.trainer-icon--soon { background: var(--border); color: var(--text-muted); }
.trainer-badge {
    font-size: .72rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(108,99,255,.1);
    padding: .25rem .7rem;
    border-radius: 20px;
}
.trainer-badge--soon {
    color: var(--text-muted);
    background: var(--border);
}
.trainer-title { font-size: 1.25rem; font-weight: 900; color: var(--dark); }
.trainer-desc { font-size: .875rem; color: var(--text-muted); line-height: 1.55; flex: 1; }
.trainer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: .25rem;
}
.trainer-count {
    font-size: .8rem;
    font-weight: 700;
    color: var(--text-muted);
}
.trainer-start {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .875rem;
    font-weight: 800;
    color: var(--primary);
    transition: var(--transition);
}
.trainer-start svg { width: 16px; height: 16px; transition: var(--transition); }
.trainer-card:hover .trainer-start { gap: .6rem; }
.trainer-card:hover .trainer-start svg { transform: translateX(3px); }

/* =================== ACCENTS TRAINER =================== */
.trainer-page {
    min-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 1rem 5rem;
    position: relative;
    overflow: hidden;
    background: var(--bg);
}

.trainer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 520px;
    padding: 1.25rem 0 .75rem;
    animation: fadeInUp .4s both;
}
.trainer-page-title {
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--dark);
}
.back-link--white {
    width: 38px; height: 38px;
    background: var(--bg-card);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    color: var(--text);
    transition: var(--transition);
}
.back-link--white svg { width: 18px; height: 18px; }
.back-link--white:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: scale(1.08);
}

/* Star button */
.btn-star {
    width: 38px; height: 38px;
    background: var(--bg-card);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: var(--transition);
}
.btn-star svg { width: 20px; height: 20px; transition: var(--transition); }
.btn-star:hover { border-color: #f59e0b; color: #f59e0b; transform: scale(1.1) rotate(15deg); }
.btn-star--active { border-color: #f59e0b; background: rgba(245,158,11,.08); }
.btn-star--active svg { fill: #f59e0b; stroke: #f59e0b; }

/* Stats chips */
.trainer-stats {
    display: flex;
    gap: .625rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    animation: fadeInUp .4s .1s both;
}
.stat-chip {
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: .4rem .9rem;
    border-radius: 20px;
    font-size: .875rem;
    font-weight: 700;
    transition: transform .2s ease;
}
.stat-chip.bump { animation: statBump .3s ease; }
@keyframes statBump {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.18); }
}
.stat-label { font-weight: 600; }
.stat-chip--correct { background: rgba(67,198,172,.12); color: var(--green); }
.stat-chip--wrong   { background: rgba(255,101,132,.12); color: var(--accent); }
.stat-chip--total   { background: rgba(108,99,255,.1);  color: var(--text-muted); }

/* Category */
.word-category {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    background: var(--border);
    padding: .25rem .75rem;
    border-radius: 20px;
    margin-bottom: 2.5rem;
    min-height: 1.5rem;
    transition: var(--transition);
}

/* Word arena */
.word-arena {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    width: 100%;
    max-width: 520px;
    min-height: 180px;
    justify-content: center;
    margin-bottom: 1.25rem;
}
.word-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
}
.loader-spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.letter-row {
    display: flex;
    flex-wrap: wrap;
    gap: .625rem;
    justify-content: center;
}

/* =================== LETTER TILES — FIXED =================== */
/*
 * IMPORTANT: tiles start invisible via JS-controlled class .letter-tile--hidden
 * NOT via CSS default opacity:0. This prevents the opacity conflict
 * with --correct / --wrong states after animation completes.
 */
.letter-tile {
    width: 52px; height: 52px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 2px solid var(--border);
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 1.25rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .2s ease, background .2s ease, color .2s ease, box-shadow .2s ease;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    /* Default fully visible — hidden state managed by JS */
    opacity: 1;
    transform: translateY(0);
}

/* Hidden state — set by JS before animation */
.letter-tile--hidden {
    opacity: 0;
    transform: translateY(18px);
}

/* Appear animation — JS adds this class to trigger entry */
.letter-tile--appear {
    animation: tileAppear 0.32s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@keyframes tileAppear {
    from { opacity: 0; transform: translateY(18px) scale(.85); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.letter-tile--vowel {
    border-color: rgba(108,99,255,.3);
    background: rgba(108,99,255,.04);
}

/* Hover & active — only when NOT locked */
.letter-tile:not(.letter-tile--locked):hover {
    border-color: var(--primary);
    background: rgba(108,99,255,.08);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(108,99,255,.2);
}
.letter-tile:not(.letter-tile--locked):active {
    transform: scale(.92);
}

/* Locked state — disable interaction, keep tile fully visible */
.letter-tile--locked {
    pointer-events: none;
    cursor: default;
}

/* Correct answer — green, stays fully opaque */
.letter-tile--correct {
    opacity: 1 !important;
    background: rgba(67,198,172,.18) !important;
    border-color: var(--green) !important;
    color: var(--green) !important;
    transform: translateY(0) !important;
    animation: correctPop .4s cubic-bezier(0.34,1.56,0.64,1) !important;
}

/* Wrong answer — red, stays fully opaque */
.letter-tile--wrong {
    opacity: 1 !important;
    background: rgba(255,101,132,.15) !important;
    border-color: var(--accent) !important;
    color: var(--accent) !important;
    transform: translateY(0) !important;
    animation: wrongShake .4s ease !important;
}

@keyframes correctPop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.25) rotate(5deg); }
    70%  { transform: scale(.95) rotate(-3deg); }
    100% { transform: scale(1) rotate(0deg); }
}
@keyframes wrongShake {
    0%, 100% { transform: translateX(0) translateY(0); }
    20%       { transform: translateX(-6px); }
    40%       { transform: translateX(6px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}

/* Feedback */
.answer-feedback {
    min-height: 2.5rem;
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    text-align: center;
    padding: .5rem 1rem;
    animation: fadeIn .25s ease;
}
.answer-feedback--correct {
    color: var(--green);
    animation: feedbackPop .35s cubic-bezier(0.34,1.56,0.64,1);
}
.answer-feedback--wrong {
    color: var(--accent);
    animation: feedbackSlide .3s ease;
}
@keyframes feedbackPop {
    from { opacity: 0; transform: scale(.8); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes feedbackSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.stress-mark {
    display: inline-block;
    border-bottom: 3px solid var(--accent);
    padding-bottom: 1px;
}

/* Next button */
.next-btn-wrap {
    display: flex;
    justify-content: center;
    margin-top: .75rem;
}
.btn-next {
    display: inline-flex;
    align-items: center;
    gap: .625rem;
    padding: .875rem 2rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 1rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 16px rgba(108,99,255,.3);
    transition: var(--transition);
    animation: fadeInUp .3s ease;
}
.btn-next svg { width: 18px; height: 18px; transition: transform .2s ease; }
.btn-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(108,99,255,.45);
}
.btn-next:hover svg { transform: translateX(5px); }
.btn-next:active { transform: translateY(0) scale(.98); }

.trainer-hint {
    font-size: .85rem;
    color: var(--text-muted);
    margin-top: .5rem;
    text-align: center;
    animation: fadeIn .3s .5s both;
}

.error-msg { color: var(--accent); text-align: center; font-size: .9rem; }

/* Confetti */
.confetti-piece {
    position: absolute;
    top: 30%;
    pointer-events: none;
    animation: confettiFall linear forwards;
    z-index: 10;
    border-radius: 2px;
}
@keyframes confettiFall {
    0%   { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
    80%  { opacity: 1; }
    100% { transform: translateY(220px) rotate(720deg) scale(.5); opacity: 0; }
}

/* =================== AI TEACHER SECTION =================== */
.section--ai { padding-top: 0; }

.ai-banner {
    position: relative;
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-mid) 100%);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    animation: scaleIn .5s .2s both;
}
@media (min-width: 720px) {
    .ai-banner {
        flex-direction: row;
        align-items: flex-start;
        gap: 3rem;
    }
    .ai-banner-left { flex: 1; }
    .ai-banner-right { flex-shrink: 0; width: 220px; }
}

.ai-banner-glow {
    position: absolute;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(108,99,255,.4) 0%, transparent 70%);
    top: -100px; right: -100px;
    pointer-events: none;
    animation: blobFloat1 10s ease-in-out infinite;
}

.ai-banner-badge {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    background: rgba(255,101,132,.15);
    color: var(--accent-light);
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: .3rem .875rem;
    border-radius: 20px;
    margin-bottom: 1rem;
    border: 1px solid rgba(255,101,132,.25);
}

.ai-banner-title {
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    font-weight: 900;
    color: #fff;
    margin-bottom: .875rem;
    line-height: 1.3;
}

.ai-banner-desc {
    font-size: .9rem;
    color: rgba(255,255,255,.65);
    line-height: 1.65;
    margin-bottom: 1.25rem;
    max-width: 480px;
}

.ai-features-list {
    display: flex;
    flex-direction: column;
    gap: .625rem;
    margin-bottom: 1.75rem;
}
.ai-feature-item {
    display: flex;
    align-items: center;
    gap: .625rem;
    font-size: .875rem;
    color: rgba(255,255,255,.8);
    font-weight: 600;
}
.ai-feature-item svg {
    width: 16px; height: 16px;
    color: var(--green);
    flex-shrink: 0;
}

.ai-banner-cta { display: flex; align-items: center; gap: 1rem; }
.ai-cta-label {
    font-size: .85rem;
    font-weight: 700;
    color: rgba(255,255,255,.45);
    letter-spacing: .03em;
}

/* AI Teachers grid */
.ai-teachers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}
.ai-teacher-card {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: var(--radius);
    padding: 1rem .75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    text-align: center;
    transition: var(--transition);
}
.ai-teacher-card:hover {
    background: rgba(255,255,255,.11);
    border-color: rgba(255,255,255,.25);
    transform: translateY(-3px);
}
.ai-teacher-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 1.1rem;
    color: #fff;
    transition: var(--transition);
}
.ai-teacher-card:hover .ai-teacher-icon { transform: scale(1.12) rotate(-8deg); }
.ai-teacher-icon--russian { background: linear-gradient(135deg, var(--primary), var(--accent)); }
.ai-teacher-icon--math    { background: linear-gradient(135deg, var(--orange), #e05f00); }
.ai-teacher-icon--history { background: linear-gradient(135deg, #8B5CF6, #6D28D9); }
.ai-teacher-icon--english { background: linear-gradient(135deg, var(--green), #2aa88a); }
.ai-teacher-name {
    font-size: .78rem;
    font-weight: 700;
    color: rgba(255,255,255,.8);
    line-height: 1.3;
}
.ai-teacher-soon {
    font-size: .7rem;
    font-weight: 700;
    color: rgba(255,255,255,.35);
    background: rgba(255,255,255,.07);
    padding: .15rem .5rem;
    border-radius: 10px;
}

/* =================== PROFILE PAGE =================== */
.profile-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
}

/* Profile header card */
.profile-header-card {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-mid) 100%);
    border-radius: var(--radius-lg);
    padding: 2rem 1.75rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    overflow: hidden;
    position: relative;
    animation: scaleIn .5s both;
}
.profile-header-glow {
    position: absolute;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(108,99,255,.4) 0%, transparent 70%);
    top: -100px; right: -80px;
    pointer-events: none;
}
.profile-big-avatar {
    width: 72px; height: 72px;
    min-width: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 20px rgba(108,99,255,.4);
}
.profile-info { position: relative; z-index: 1; }
.profile-full-name {
    font-size: 1.4rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: .2rem;
}
.profile-email {
    font-size: .875rem;
    color: rgba(255,255,255,.55);
}
.profile-member-since {
    font-size: .78rem;
    color: rgba(255,255,255,.35);
    margin-top: .25rem;
}

/* Stats grid */
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
@media (min-width: 520px) {
    .profile-stats-grid { grid-template-columns: repeat(4, 1fr); }
}
.profile-stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.25rem 1rem;
    text-align: center;
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow-sm);
    animation: fadeInUp .4s both;
    transition: var(--transition);
}
.profile-stat-card:hover {
    border-color: rgba(108,99,255,.2);
    box-shadow: var(--shadow);
    transform: translateY(-3px);
}
.profile-stat-card:nth-child(1) { animation-delay: .1s; }
.profile-stat-card:nth-child(2) { animation-delay: .17s; }
.profile-stat-card:nth-child(3) { animation-delay: .24s; }
.profile-stat-card:nth-child(4) { animation-delay: .31s; }
.profile-stat-value {
    font-family: 'Nunito', sans-serif;
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: .25rem;
}
.profile-stat-value--total   { color: var(--primary); }
.profile-stat-value--correct { color: var(--green); }
.profile-stat-value--wrong   { color: var(--accent); }
.profile-stat-value--pct     { color: var(--orange); }
.profile-stat-label {
    font-size: .78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Section card */
.profile-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--border);
    overflow: hidden;
    margin-bottom: 1.25rem;
    animation: fadeInUp .5s .2s both;
}
.profile-section-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.profile-section-title {
    font-size: 1rem;
    font-weight: 900;
    color: var(--dark);
}
.profile-section-body { padding: 1.5rem; }

/* Recent activity list */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: .625rem;
}
.activity-item {
    display: flex;
    align-items: center;
    gap: .875rem;
    padding: .75rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--bg);
    transition: var(--transition);
}
.activity-item:hover { background: rgba(108,99,255,.05); }
.activity-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.activity-dot--correct { background: var(--green); }
.activity-dot--wrong   { background: var(--accent); }
.activity-word {
    flex: 1;
    font-weight: 700;
    font-size: .9rem;
    color: var(--dark);
}
.activity-time {
    font-size: .78rem;
    color: var(--text-muted);
}

/* Progress bar */
.profile-progress-bar-wrap {
    background: var(--border);
    border-radius: 20px;
    height: 10px;
    overflow: hidden;
    margin-top: .5rem;
}
.profile-progress-bar {
    height: 100%;
    border-radius: 20px;
    background: linear-gradient(90deg, var(--primary), var(--green));
    transition: width 1s cubic-bezier(0.34,1.56,0.64,1);
    width: 0%;
}

/* Empty state */
.profile-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: .9rem;
}

/* =================== MOBILE RESPONSIVE =================== */
@media (max-width: 400px) {
    .letter-tile {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
    .letter-row { gap: .5rem; }
    .auth-card { padding: 2rem 1.25rem; }
    .profile-big-avatar { width: 56px; height: 56px; min-width: 56px; font-size: 1.25rem; }
    .profile-header-card { gap: 1rem; padding: 1.5rem 1.25rem; }
}
