/* ===== Auth Pages — split layout with branding ===== */
body { background: var(--bg-page); }

.auth-layout { padding: 0 !important; }
.auth-main {
    padding: 0 !important;
    min-height: 100vh;
    display: block !important;
}
.auth-controls {
    z-index: 1500;
}

.auth-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    width: 100%;
}

/* ====== Левая часть — брендинг ====== */
.auth-brand {
    position: relative;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 4rem;
    overflow: hidden;
}
.auth-brand::before, .auth-brand::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.auth-brand::before {
    width: 480px; height: 480px;
    background: radial-gradient(circle, rgba(255,255,255,0.15), transparent 70%);
    top: -120px; right: -120px;
}
.auth-brand::after {
    width: 360px; height: 360px;
    background: radial-gradient(circle, rgba(139,92,246,0.25), transparent 70%);
    bottom: -100px; left: -100px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-bottom: 3rem;
    position: relative;
    z-index: 1;
}
.brand-logo-icon {
    width: 56px; height: 56px;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    backdrop-filter: blur(8px);
}
.brand-logo-text strong {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.brand-logo-text span {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.85);
}

.brand-content {
    position: relative;
    z-index: 1;
    max-width: 480px;
}
.brand-headline {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}
.brand-headline .accent {
    background: linear-gradient(90deg, #fef3c7, #fbcfe8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.brand-sub {
    font-size: 1rem;
    color: rgba(255,255,255,0.85);
    line-height: 1.6;
    margin-bottom: 2.5rem;
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.brand-feature {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 0.75rem;
    backdrop-filter: blur(8px);
    transition: transform 0.2s, background 0.2s;
}
.brand-feature:hover { transform: translateX(4px); background: rgba(255,255,255,0.15); }
.brand-feature-icon {
    width: 38px; height: 38px;
    background: rgba(255,255,255,0.2);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.brand-feature-text strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}
.brand-feature-text span {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.75);
}

.brand-footer {
    margin-top: auto;
    padding-top: 2.5rem;
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
    position: relative;
    z-index: 1;
}

/* ====== Правая часть — форма ====== */
.auth-form-pane {
    background: var(--bg-page);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
}
.auth-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    box-shadow: var(--shadow-md);
    padding: 2.75rem;
    width: 100%;
    max-width: 460px;
    animation: authIn 0.4s ease-out;
}
@keyframes authIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-header {
    margin-bottom: 2rem;
    text-align: left;
}
.auth-eyebrow {
    display: inline-block;
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.3rem 0.7rem;
    border-radius: 1rem;
    margin-bottom: 1rem;
}
.auth-header h2 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.auth-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.auth-form { margin-bottom: 1.25rem; }
.auth-form .form-group { margin-bottom: 1.25rem; }
.auth-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.45rem;
}
.auth-form input,
.auth-form select {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: 0.75rem;
    font-size: 0.95rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.15s;
}
.auth-form input:focus,
.auth-form select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(37,99,235,0.12);
}

.auth-form .btn-primary {
    width: 100%;
    padding: 0.9rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 0.75rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.25rem;
    box-shadow: 0 4px 12px rgba(37,99,235,0.25);
}
.auth-form .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37,99,235,0.35);
}

.password-field { position: relative; }
.password-field input { padding-right: 3rem; }
.password-toggle {
    position: absolute;
    right: 0.85rem; top: 50%; transform: translateY(-50%);
    background: none; border: none;
    color: var(--text-secondary);
    cursor: pointer; padding: 0;
    display: flex;
}
.password-toggle:hover { color: var(--text-primary); }

.auth-footer {
    text-align: center;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
}
.auth-footer p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 0.6rem; }
.auth-footer a { color: var(--color-primary); font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

.admin-hint {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-radius: 0.75rem;
    color: #1e3a8a;
    font-size: 0.8rem;
    border-left: 4px solid var(--color-primary);
    text-align: left;
    line-height: 1.5;
}
[data-theme="dark"] .admin-hint {
    background: rgba(37,99,235,0.15);
    color: #93c5fd;
}

/* Demo credentials block */
.demo-credentials {
    margin-top: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f0f9ff, #eff6ff);
    border: 1px dashed #93c5fd;
    border-radius: 0.875rem;
    text-align: left;
}
[data-theme="dark"] .demo-credentials {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.4);
}
.demo-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    text-align: center;
}
.demo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}
.demo-card {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.65rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.6rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
    font-family: inherit;
    width: 100%;
}
.demo-card:hover {
    transform: translateY(-2px);
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}
.demo-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    line-height: 1;
}
.demo-info { flex: 1; min-width: 0; overflow: hidden; }
.demo-info strong {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}
.demo-info code {
    display: block;
    font-size: 0.68rem;
    color: var(--text-secondary);
    font-family: 'Consolas', 'Monaco', monospace;
    margin-top: 0.15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.demo-card.demo-admin   { border-left: 3px solid #8b5cf6; }
.demo-card.demo-teacher { border-left: 3px solid #2563eb; }
.demo-card.demo-student { border-left: 3px solid #10b981; }
.demo-card.demo-parent  { border-left: 3px solid #f59e0b; }
.demo-hint {
    margin-top: 0.6rem;
    font-size: 0.7rem;
    color: var(--text-tertiary);
    text-align: center;
    font-style: italic;
}

/* ====== Адаптивность ====== */
@media (max-width: 1024px) {
    .auth-split { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
    .auth-form-pane { padding: 2rem 1rem; }
}
@media (max-width: 480px) {
    .auth-card { padding: 1.75rem 1.5rem; border-radius: 1rem; }
    .auth-header h2 { font-size: 1.65rem; }
}
