/* =========================================================================
   ScholaRef — shared site chrome & design system (2026)
   Used by public/content pages (auth, legal, docs, blog, status) via
   site_base.html. Matches the landing page: Manrope + Sora, light, editorial.
   ========================================================================= */

:root {
    --bg:            #ffffff;
    --bg-subtle:     #f7f8fa;
    --bg-muted:      #f1f3f6;

    --ink:           #0f1729;
    --ink-2:         #26303f;
    --muted:         #5c6675;
    --muted-2:       #8b93a1;

    --line:          #e6e8ec;
    --line-2:        #eef0f3;

    --brand:         #1f6feb;
    --brand-600:     #1a5fd0;
    --brand-700:     #1550b8;
    --brand-tint:    #eaf1fe;
    --brand-tint-2:  #f2f7ff;

    --dark:          #0b1220;
    --dark-2:        #0f1830;
    --dark-line:     rgba(255,255,255,.10);
    --dark-muted:    #9aa4b6;

    --ok:            #12855b;
    --ok-tint:       #e6f5ee;
    --warn:          #b26a00;
    --warn-tint:     #fdf1e0;
    --danger:        #d1443a;
    --danger-tint:   #fdecea;

    --radius:        14px;
    --radius-lg:     20px;
    --radius-sm:     10px;
    --shadow-sm:     0 1px 2px rgba(15,23,41,.05);
    --shadow:        0 8px 24px -12px rgba(15,23,41,.16);
    --shadow-lg:     0 30px 60px -24px rgba(15,23,41,.28);

    --maxw:          1140px;
    --font:          'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --display:       'Sora', var(--font);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--ink-2);
    font-size: 16px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
body.nav-open { overflow: hidden; }

img { max-width: 100%; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); }

h1, h2, h3, h4, h5 {
    font-family: var(--display);
    color: var(--ink);
    line-height: 1.2;
    letter-spacing: -.02em;
    margin: 0;
    font-weight: 700;
}

.container {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 24px;
}
.container-narrow { max-width: 820px; }

/* ---------- Buttons ---------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    font-family: var(--font);
    font-weight: 700;
    font-size: .95rem;
    line-height: 1;
    padding: .72rem 1.15rem;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
    white-space: nowrap;
    text-decoration: none;
}
.btn i { font-size: .9em; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 18px -10px rgba(31,111,235,.7); }
.btn-primary:hover { background: var(--brand-600); color: #fff; }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: #cdd2da; background: var(--bg-subtle); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--bg-muted); }
.btn-lg { padding: .9rem 1.5rem; font-size: 1rem; border-radius: 11px; }
.btn-block { width: 100%; }

/* ---------- Navbar (same as landing) ----------------------------------- */
.nav {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(255,255,255,.85);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
}
.nav-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.nav-brand { display: flex; align-items: center; flex: 0 0 auto; }
.nav-brand img { height: 28px; width: auto; }
.nav-links {
    display: flex;
    align-items: center;
    gap: 1.7rem;
    margin: 0 auto;
    font-size: .92rem;
    font-weight: 600;
}
.nav-links a { color: var(--ink-2); transition: color .15s ease; }
.nav-links a:hover { color: var(--brand); }
.nav-actions { display: flex; align-items: center; gap: .6rem; flex: 0 0 auto; }
.nav-lang { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 800; color: var(--muted-2); margin-right: .3rem; }
.nav-lang a, .nav-lang span { padding: 2px 3px; }
.nav-lang .is-active { color: var(--ink); }
.nav-lang a:hover { color: var(--brand); }
.nav-lang .sep { color: var(--line); font-weight: 500; }
.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 9px;
    width: 40px; height: 38px;
    color: var(--ink);
    font-size: 1.05rem;
    cursor: pointer;
}

/* ---------- Main + page header ----------------------------------------- */
.site-main { flex: 1 0 auto; }

.page-head {
    background: radial-gradient(1100px 420px at 50% -20%, var(--brand-tint-2), transparent 60%);
    border-bottom: 1px solid var(--line);
    padding: 56px 0 44px;
    text-align: center;
}
.page-head .eyebrow { font-size: .74rem; font-weight: 800; letter-spacing: .16em; color: var(--brand); text-transform: uppercase; }
.page-head h1 { font-size: clamp(2rem, 4vw, 2.9rem); margin: 12px 0 0; font-weight: 800; }
.page-head p { color: var(--muted); font-size: 1.05rem; margin: 14px auto 0; max-width: 44rem; }
.page-head .meta { color: var(--muted-2); font-size: .85rem; margin-top: 10px; }

/* ---------- Prose (legal / docs / blog long-form) ---------------------- */
.prose { color: var(--ink-2); font-size: 1rem; line-height: 1.75; }
.prose > :first-child { margin-top: 0; }
.prose h1 { font-size: 2rem; margin: 2.2rem 0 1rem; }
.prose h2 { font-size: 1.5rem; margin: 2.2rem 0 .9rem; padding-top: .4rem; }
.prose h3 { font-size: 1.2rem; margin: 1.8rem 0 .6rem; }
.prose h4 { font-size: 1.02rem; margin: 1.4rem 0 .5rem; }
.prose p { margin: 0 0 1.1rem; }
.prose ul, .prose ol { margin: 0 0 1.1rem; padding-left: 1.4rem; }
.prose li { margin: .35rem 0; }
.prose a { color: var(--brand); border-bottom: 1px solid rgba(31,111,235,.3); }
.prose a:hover { border-bottom-color: var(--brand); }
.prose strong { color: var(--ink); font-weight: 700; }
.prose blockquote {
    margin: 1.2rem 0; padding: .6rem 1.2rem;
    border-left: 3px solid var(--brand); background: var(--bg-subtle);
    border-radius: 0 10px 10px 0; color: var(--muted);
}
.prose code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .88em; background: var(--bg-muted); border: 1px solid var(--line);
    border-radius: 6px; padding: .1em .4em;
}
.prose pre {
    background: var(--dark); color: #e6edf7; padding: 1rem 1.2rem;
    border-radius: 12px; overflow-x: auto; margin: 0 0 1.1rem;
}
.prose pre code { background: none; border: none; color: inherit; padding: 0; }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 2rem 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.2rem; font-size: .92rem; }
.prose th, .prose td { text-align: left; padding: 10px 14px; border: 1px solid var(--line); }
.prose th { background: var(--bg-subtle); font-weight: 700; color: var(--ink); }

/* A bordered card wrapper for content sections */
.site-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 32px;
}

/* ---------- Auth (login / register / password) ------------------------- */
.auth-wrap {
    flex: 1 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    background: radial-gradient(900px 500px at 50% -10%, var(--brand-tint-2), transparent 62%);
}
.auth-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    padding: 38px 36px;
}
.auth-card--wide { max-width: 560px; }
.auth-head { text-align: center; margin-bottom: 26px; }
.auth-logo img { height: 34px; width: auto; margin: 0 auto 14px; display: block; }
.auth-head h1 { font-size: 1.6rem; font-weight: 800; }
.auth-head p { color: var(--muted); font-size: .92rem; margin: 8px 0 0; }

.field { margin-bottom: 16px; }
.field > label {
    display: block; font-size: .84rem; font-weight: 700;
    color: var(--ink); margin-bottom: 7px;
}
.field input, .field select, .field textarea,
.auth-card input:not([type=checkbox]):not([type=radio]),
.auth-card select, .auth-card textarea {
    width: 100%;
    padding: 11px 13px;
    font-size: .95rem;
    font-family: var(--font);
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.field input::placeholder { color: var(--muted-2); }
.field input:focus, .field select:focus, .field textarea:focus,
.auth-card input:focus, .auth-card select:focus, .auth-card textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(31,111,235,.14);
}
.password-input-wrap { position: relative; display: flex; align-items: center; }
.password-input-wrap input { padding-right: 44px; }
.password-toggle {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    border: none; background: transparent; color: var(--muted-2);
    cursor: pointer; font-size: .95rem; padding: 6px; border-radius: 6px; line-height: 1;
}
.password-toggle:hover { color: var(--ink); }

.field-hint { font-size: .8rem; color: var(--muted); margin-top: 6px; }
.field-row-right { text-align: right; margin-bottom: 8px; font-size: .84rem; }

.oauth-divider {
    margin: 20px 0 12px; text-align: center; font-size: .78rem;
    color: var(--muted-2); position: relative;
}
.oauth-divider::before, .oauth-divider::after {
    content: ""; position: absolute; top: 50%; width: 38%; height: 1px; background: var(--line);
}
.oauth-divider::before { left: 0; } .oauth-divider::after { right: 0; }
.oauth-btn {
    width: 100%; padding: 11px; border-radius: 10px;
    border: 1px solid var(--line); background: #fff; color: var(--ink);
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    font-size: .95rem; font-weight: 700; text-decoration: none; margin-top: 4px;
    transition: border-color .15s ease, background .15s ease;
}
.oauth-btn:hover { border-color: #cdd2da; background: var(--bg-subtle); color: var(--ink); }

.auth-foot { text-align: center; margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.auth-foot p { font-size: .9rem; color: var(--muted); margin: 0 0 8px; }
.auth-foot a { font-weight: 700; }
.auth-foot .fineprint { margin-top: 14px; font-size: .8rem; color: var(--muted-2); }
.auth-foot .fineprint a { color: var(--muted); border-bottom: 1px solid var(--line); }

.auth-features {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px;
    margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line);
}
.auth-features .feature { display: flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--muted); }
.auth-features .feature i { color: var(--ok); font-size: .85rem; }

/* ---------- Alerts ----------------------------------------------------- */
.alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 14px; border-radius: 10px; margin-bottom: 18px;
    font-size: .9rem; line-height: 1.5; border: 1px solid var(--line); background: var(--bg-subtle);
}
.alert i { flex-shrink: 0; margin-top: .15rem; }
.alert-error { background: var(--danger-tint); border-color: #f3c6c1; color: #9a2b22; }
.alert-error i { color: var(--danger); }
.alert-success { background: var(--ok-tint); border-color: #bce6d1; color: #0c6a49; }
.alert-success i { color: var(--ok); }
.alert-info { background: var(--brand-tint); border-color: #cfe0fb; color: var(--brand-700); }
.alert-info i { color: var(--brand); }

/* ---------- Footer (same as landing) ----------------------------------- */
.foot { background: var(--dark-2); color: #c3cbd9; padding: 60px 0 0; flex-shrink: 0; }
.foot-inner { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.foot-brand img { height: 26px; margin-bottom: 16px; filter: brightness(0) invert(1); }
.foot-brand p { font-size: .9rem; line-height: 1.65; max-width: 30rem; color: var(--dark-muted); }
.foot-col h4 { color: #fff; font-family: var(--font); font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 16px; }
.foot-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 11px; }
.foot-col a { font-size: .9rem; color: var(--dark-muted); transition: color .15s ease; }
.foot-col a:hover { color: #fff; }
.foot-bottom {
    margin-top: 50px; border-top: 1px solid var(--dark-line);
    padding: 22px 0; display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap; font-size: .82rem; color: var(--dark-muted);
}
.foot-bottom a { color: #c3cbd9; }
.foot-bottom a:hover { color: #fff; }
.foot-lang { display: inline-flex; gap: .8rem; align-items: center; }
.foot-lang a, .foot-lang span { color: var(--dark-muted); font-weight: 700; }
.foot-lang .is-active { color: #fff; }
.foot-lang .sep { opacity: .4; }

/* ---------- Responsive ------------------------------------------------- */
@media (max-width: 960px) {
    .nav-links {
        position: fixed; inset: 62px 0 auto 0;
        flex-direction: column; align-items: stretch; gap: 0;
        background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
        padding: 8px 0; margin: 0; display: none;
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 13px 24px; border-bottom: 1px solid var(--line-2); }
    .nav-toggle { display: inline-flex; align-items: center; justify-content: center; margin-left: auto; }
    .nav-actions .btn-ghost { display: none; }
    .foot-inner { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 560px) {
    .auth-card { padding: 30px 22px; }
    .auth-features { grid-template-columns: 1fr; }
    .foot-inner { grid-template-columns: 1fr; }
    .page-head { padding: 40px 0 32px; }
}
