/* Agentic Engineering Course - Shared auth and member surface CSS */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    --auth-bg: #f3f6f8;
    --auth-bg-glow: rgba(37, 99, 235, 0.14);
    --auth-bg-glow-2: rgba(20, 184, 122, 0.12);
    --auth-text: #223246;
    --auth-text-strong: #101827;
    --auth-text-muted: #53657b;
    --auth-text-soft: #6b7b8f;
    --auth-surface: rgba(255, 255, 255, 0.94);
    --auth-surface-alt: #f8fbfd;
    --auth-border: #ccd8e5;
    --auth-border-strong: #afc1d2;
    --auth-primary: #2563eb;
    --auth-primary-hover: #1d4ed8;
    --auth-primary-soft: rgba(37, 99, 235, 0.12);
    --auth-danger: #b91c1c;
    --auth-danger-strong: #dc2626;
    --auth-danger-soft: rgba(220, 38, 38, 0.08);
    --auth-danger-border: rgba(220, 38, 38, 0.18);
    --auth-success: #166534;
    --auth-success-strong: #16a34a;
    --auth-success-soft: rgba(22, 163, 74, 0.08);
    --auth-success-border: rgba(22, 163, 74, 0.18);
    --auth-warning: #b45309;
    --auth-warning-soft: rgba(245, 158, 11, 0.12);
    --auth-warning-border: rgba(245, 158, 11, 0.22);
    --auth-shadow: 0 26px 64px rgba(15, 23, 42, 0.12);
    --auth-switcher-shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
    --auth-radius-xl: 28px;
    --auth-radius-lg: 22px;
    --auth-radius-md: 16px;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --auth-bg: #0c1118;
    --auth-bg-glow: rgba(37, 99, 235, 0.16);
    --auth-bg-glow-2: rgba(20, 184, 122, 0.1);
    --auth-text: #d9e2ec;
    --auth-text-strong: #f8fafc;
    --auth-text-muted: #94a3b8;
    --auth-text-soft: #677487;
    --auth-surface: rgba(16, 22, 31, 0.94);
    --auth-surface-alt: #111926;
    --auth-border: rgba(148, 163, 184, 0.16);
    --auth-border-strong: rgba(148, 163, 184, 0.26);
    --auth-primary: #4f8cff;
    --auth-primary-hover: #78a6ff;
    --auth-primary-soft: rgba(79, 140, 255, 0.14);
    --auth-danger: #fca5a5;
    --auth-danger-strong: #ef4444;
    --auth-danger-soft: rgba(239, 68, 68, 0.12);
    --auth-danger-border: rgba(239, 68, 68, 0.24);
    --auth-success: #86efac;
    --auth-success-strong: #22c55e;
    --auth-success-soft: rgba(34, 197, 94, 0.12);
    --auth-success-border: rgba(34, 197, 94, 0.22);
    --auth-warning: #fcd34d;
    --auth-warning-soft: rgba(245, 158, 11, 0.14);
    --auth-warning-border: rgba(245, 158, 11, 0.24);
    --auth-shadow: 0 30px 70px rgba(0, 0, 0, 0.42);
    --auth-switcher-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
}

html[data-theme="light"] {
    color-scheme: light;
    --auth-bg: #edf3f8;
    --auth-text: #1f3044;
    --auth-text-strong: #0f1728;
    --auth-text-muted: #4d6076;
    --auth-text-soft: #64758a;
    --auth-surface: rgba(255, 255, 255, 0.96);
    --auth-surface-alt: #f4f7fb;
    --auth-border: #c9d7e5;
    --auth-border-strong: #aebfd1;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    width: 100%;
}

body {
    background:
        radial-gradient(circle at top left, var(--auth-bg-glow), transparent 32%),
        radial-gradient(circle at top right, var(--auth-bg-glow-2), transparent 36%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 26%),
        var(--auth-bg);
    color: var(--auth-text);
    font-family: 'Manrope', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 28px 20px 44px;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(15, 23, 42, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.025) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.45), transparent 80%);
    pointer-events: none;
    z-index: 0;
}

body.account-page,
body.checkout-page,
body.admin-dashboard-page,
body.admin-student-page {
    align-items: flex-start;
}

.auth-container {
    width: min(100%, 460px);
    position: relative;
    z-index: 1;
}

.auth-shell {
    width: min(100%, 1060px);
    display: grid;
    grid-template-columns: minmax(300px, 0.88fr) minmax(0, 1fr);
    gap: 22px;
    position: relative;
    z-index: 1;
}

.auth-shell--compact {
    width: min(100%, 900px);
}

.auth-shell--login {
    width: min(100%, 980px);
    grid-template-columns: minmax(320px, 0.92fr) minmax(420px, 1fr);
    align-items: stretch;
}

.auth-card,
.auth-sidebar {
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-xl);
    box-shadow: var(--auth-shadow);
    backdrop-filter: blur(18px);
}

.auth-card {
    padding: 38px 34px;
}

.auth-sidebar {
    padding: 28px 26px;
    display: grid;
    align-content: start;
    gap: 18px;
    position: relative;
    overflow: hidden;
}

.auth-sidebar--dark {
    background: linear-gradient(180deg, rgba(17, 25, 38, 0.98), rgba(15, 23, 42, 0.94));
    border-color: rgba(148, 163, 184, 0.12);
    color: #f8fafc;
}

.auth-sidebar--dark .auth-sidebar-title,
.auth-sidebar--dark .auth-sidebar-kicker,
.auth-sidebar--dark .auth-sidebar-list strong {
    color: #f8fafc;
}

.auth-sidebar--dark .auth-sidebar-copy,
.auth-sidebar--dark .auth-sidebar-list li,
.auth-sidebar--dark .auth-sidebar-note {
    color: rgba(255, 255, 255, 0.74);
}

.login-page .auth-shell--login {
    min-height: min(760px, calc(100vh - 72px));
}

.login-page .auth-sidebar::after {
    content: '';
    position: absolute;
    inset: auto -15% -18% auto;
    width: 240px;
    height: 240px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(79, 140, 255, 0.26), transparent 68%);
    pointer-events: none;
}

.login-page .auth-card {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-card--login {
    position: relative;
}

.login-hero {
    gap: 20px;
}

.login-hero-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.login-hero-metric,
.login-hero-card {
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(255, 255, 255, 0.05);
    padding: 16px 18px;
}

.login-hero-metric {
    display: grid;
    gap: 6px;
}

.login-hero-metric__label {
    color: rgba(255, 255, 255, 0.62);
    font: 700 0.68rem/1 "IBM Plex Mono", monospace;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-hero-metric__value {
    color: #f8fafc;
    font-size: 1rem;
    line-height: 1.3;
}

.login-hero-grid {
    display: grid;
    gap: 12px;
}

.login-hero-card__title {
    color: #f8fafc;
    font-size: 0.98rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.login-hero-card__copy {
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.92rem;
    line-height: 1.65;
}

.auth-form--login {
    gap: 18px;
}

.login-page .auth-header,
.login-page .auth-form,
.login-page .auth-footer {
    position: relative;
    z-index: 1;
}

.login-page .auth-footer {
    text-align: left;
}

.auth-header {
    margin-bottom: 28px;
    text-align: left;
}

.auth-header-chip,
.auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid var(--auth-border);
    color: var(--auth-text-muted);
    font: 700 0.72rem/1 "IBM Plex Mono", monospace;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.auth-header-chip::before,
.auth-kicker::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--auth-primary);
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.12);
}

.auth-logo {
    font-size: 1rem;
    font-weight: 800;
    color: var(--auth-text-strong);
    letter-spacing: -0.03em;
    margin-bottom: 10px;
}

.auth-title {
    font-size: clamp(1.9rem, 3vw, 2.6rem);
    line-height: 1.05;
    font-weight: 800;
    color: var(--auth-text-strong);
    letter-spacing: -0.04em;
    margin-bottom: 10px;
}

.auth-subtitle {
    font-size: 0.98rem;
    color: var(--auth-text-muted);
    margin-bottom: 0;
    max-width: 48ch;
}

.auth-sidebar-kicker {
    color: var(--auth-text-strong);
    font: 700 0.72rem/1 "IBM Plex Mono", monospace;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-sidebar-title {
    color: var(--auth-text-strong);
    font-size: clamp(1.6rem, 2.5vw, 2.2rem);
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.auth-sidebar-copy {
    color: var(--auth-text-muted);
    font-size: 0.98rem;
    line-height: 1.72;
}

.auth-sidebar-list {
    list-style: none;
    display: grid;
    gap: 12px;
}

.auth-sidebar-list li {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border-radius: var(--auth-radius-md);
    border: 1px solid var(--auth-border);
    background: var(--auth-surface-alt);
    color: var(--auth-text-muted);
}

.auth-sidebar--dark .auth-sidebar-list li {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(148, 163, 184, 0.1);
}

.auth-sidebar-list strong {
    color: var(--auth-text-strong);
    font-size: 0.98rem;
}

.auth-sidebar-note {
    color: var(--auth-text-soft);
    font-size: 0.9rem;
    line-height: 1.65;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-label {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--auth-text);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.form-input {
    background: var(--auth-surface-alt);
    border: 1px solid var(--auth-border);
    border-radius: 16px;
    padding: 14px 16px;
    color: var(--auth-text-strong);
    font-family: 'Manrope', sans-serif;
    font-size: 0.96rem;
    font-weight: 600;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--auth-primary);
    background: var(--auth-surface-alt);
    box-shadow: 0 0 0 4px var(--auth-primary-soft);
}

.form-input::placeholder {
    color: var(--auth-text-soft);
}

.form-input.is-invalid {
    border-color: var(--auth-danger-strong);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

.form-note {
    color: var(--auth-text-soft);
    font-size: 0.8rem;
    line-height: 1.6;
}

.field-error {
    color: var(--auth-danger);
    font-size: 0.8rem;
    line-height: 1.5;
    min-height: 18px;
}

.field-error:empty {
    display: none;
}

.form-message {
    padding: 14px 16px;
    border-radius: 16px;
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 18px;
}

.form-message.error {
    background: var(--auth-danger-soft);
    border: 1px solid var(--auth-danger-border);
    color: var(--auth-danger);
}

.form-message.success {
    background: var(--auth-success-soft);
    border: 1px solid var(--auth-success-border);
    color: var(--auth-success);
}

.form-button {
    background: var(--auth-primary);
    border: 1px solid var(--auth-primary);
    border-radius: 16px;
    min-height: 54px;
    padding: 12px 18px;
    color: #fff;
    font-family: 'Manrope', sans-serif;
    font-size: 0.96rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    letter-spacing: 0.01em;
    margin-top: 8px;
}

.form-button:hover {
    background: var(--auth-primary-hover);
    border-color: var(--auth-primary-hover);
    box-shadow: 0 16px 28px rgba(37, 99, 235, 0.24);
    transform: translateY(-1px);
}

.form-button:active {
    transform: scale(0.99);
}

.form-button:disabled {
    background: #94a3b8;
    border-color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.65;
    box-shadow: none;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid var(--auth-border);
}

.auth-footer-text {
    font-size: 0.92rem;
    color: var(--auth-text);
}

.auth-footer-link {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s ease;
}

.auth-footer-link:hover {
    color: var(--auth-primary-hover);
    text-decoration: underline;
}

.auth-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    margin-top: 14px;
}

.form-divider {
    text-align: center;
    margin: 24px 0;
    position: relative;
}

.form-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--auth-border);
}

.form-divider-text {
    position: relative;
    display: inline-block;
    background: var(--auth-surface);
    padding: 0 12px;
    color: var(--auth-text-soft);
    font-size: 13px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.checkbox-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--auth-primary);
}

.checkbox-label {
    cursor: pointer;
    color: var(--auth-text);
}

.checkbox-label a {
    color: var(--auth-primary);
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

.alert {
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 20px;
    font-size: 0.92rem;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.alert-icon {
    flex-shrink: 0;
    margin-top: 2px;
    font-weight: 800;
}

.alert.info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.22);
    color: #1d4ed8;
}

.alert.warning {
    background: var(--auth-warning-soft);
    border: 1px solid var(--auth-warning-border);
    color: var(--auth-warning);
}

.password-meter {
    height: 6px;
    background: var(--auth-border);
    border-radius: 999px;
    margin-top: 8px;
    overflow: hidden;
}

.password-meter-fill {
    height: 100%;
    width: 0;
    transition: width 0.3s ease;
    border-radius: 999px;
}

.password-meter-fill.weak {
    width: 33%;
    background: #ef4444;
}

.password-meter-fill.fair {
    width: 66%;
    background: #f59e0b;
}

.password-meter-fill.good {
    width: 100%;
    background: #10b981;
}

.is-loading {
    opacity: 0.76;
    pointer-events: none;
}

.redirect-notice {
    text-align: center;
    padding: 24px;
}

.redirect-notice-text {
    color: var(--auth-text-muted);
    margin-bottom: 14px;
}

.redirect-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--auth-border);
    border-top-color: var(--auth-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 920px) {
    .auth-shell,
    .auth-shell--compact {
        grid-template-columns: 1fr;
    }

    .auth-shell--login {
        min-height: auto;
    }

    .auth-sidebar {
        order: -1;
    }

    .login-hero-metrics {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    body {
        padding: 18px 14px 30px;
    }

    .auth-card,
    .auth-sidebar {
        padding: 24px 20px;
        border-radius: 22px;
    }

    .auth-footer-links {
        flex-direction: column;
        gap: 10px;
    }

    .auth-title {
        font-size: 1.7rem;
    }

    .form-button {
        min-height: 52px;
        font-size: 0.92rem;
    }

    .auth-footer {
        margin-top: 20px;
        padding-top: 20px;
    }
}
