/* ScholaNova · sign-in page. Builds on sn.css tokens (light + dark). */

.sn-bare .sn-skip { display: none; }

.lg {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 72px 20px 40px;
    background: var(--bg-tint), var(--bg);
}

/* ── Form side ────────────────────────────────────────────────────────── */
.lg__center { width: 100%; display: grid; place-items: center; }

.lg__back:hover { color: var(--brand); }
.lg__theme { position: absolute; top: 14px; right: 18px; }

.lg__card {
    width: 100%; max-width: 420px;
    padding: clamp(24px, 5vw, 36px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-md);
}
.lg__logo { display: inline-flex; align-items: center; gap: 11px; margin-bottom: 22px; font-family: var(--font-display); font-weight: 600; font-size: 20px; color: var(--ink); }
.lg__logo:hover { color: var(--ink); }
.lg__title { font-family: var(--font-display); font-size: clamp(1.6rem, 1.35rem + 1vw, 1.95rem); font-weight: 500; letter-spacing: -.018em; line-height: 1.15; }
.lg__sub { margin: 6px 0 24px; color: var(--muted); }

/* Alert (server message) */
.lg__alert {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 13px 15px; margin-bottom: 20px;
    border-radius: 12px; font-size: 14px; font-weight: 500; line-height: 1.45;
    color: var(--danger); background: var(--danger-soft);
    border: 1px solid color-mix(in srgb, var(--danger) 22%, transparent);
    animation: lg-shake .45s;
}
.lg__alert::before { content: "\f06a"; font: 900 15px/1.45 "Font Awesome 6 Free"; flex-shrink: 0; }
.lg__alert--info { color: var(--info); background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 22%, transparent); animation: none; }
.lg__alert--info::before { content: "\f05a"; }
@keyframes lg-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* Fields */
.lg__field { margin-bottom: 18px; }
.lg__field label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 600; }
.lg__control { position: relative; }
.lg__ico { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); font-size: 14px; color: var(--muted); pointer-events: none; transition: color .15s; }
.lg__input {
    width: 100%; height: 48px; padding: 0 16px 0 42px;
    font: inherit; font-size: 15px; color: var(--ink);
    background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 12px;
    transition: border-color .15s, box-shadow .15s;
}
.lg__input--pw { padding-right: 46px; }
.lg__input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.lg__input:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line-strong)); }
.lg__input:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.lg__control:focus-within .lg__ico { color: var(--brand); }
.lg__input:-webkit-autofill { -webkit-text-fill-color: var(--ink); box-shadow: 0 0 0 100px var(--surface) inset; }
.lg__eye {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 36px; height: 36px; border: 0; border-radius: 9px; background: none;
    color: var(--muted); cursor: pointer; font-size: 15px;
}
.lg__eye:hover { color: var(--ink); background: var(--surface-2); }
.lg__fielderr { display: none; margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--danger); }
.lg__field.is-bad .lg__fielderr { display: block; }
.lg__field.is-bad .lg__input { border-color: var(--danger); }
.lg__field.is-bad .lg__input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 28%, transparent); }
.lg__caps { display: inline-flex; align-items: center; gap: 6px; margin-top: 7px; font-size: 12.5px; font-weight: 600; color: var(--warn); }

.lg__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 22px; }
.lg__check { display: inline-flex; align-items: center; gap: 9px; margin: 0; font-size: 13.5px; font-weight: 500; color: var(--muted); cursor: pointer; }
.lg__check input { width: 17px; height: 17px; accent-color: var(--btn-bg); cursor: pointer; }
.lg__link { font-size: 13.5px; font-weight: 600; }

/* Primary action */
.lg__submit { width: 100%; height: 50px; font-size: 15.5px; border-radius: 12px; box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--btn-bg) 70%, transparent); }
.lg__submit.is-loading {
    color: transparent;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='12' cy='12' r='9' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-dasharray='42 20'><animateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='.8s' repeatCount='indefinite'/></circle></svg>");
    background-repeat: no-repeat; background-position: center; background-size: 24px;
}
html[data-theme="dark"] .lg__submit.is-loading {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='12' cy='12' r='9' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-dasharray='42 20'><animateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='.8s' repeatCount='indefinite'/></circle></svg>");
}

.lg__or { position: relative; margin: 26px 0 18px; text-align: center; font-size: 13px; color: var(--muted); }
.lg__or::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line); }
.lg__or span { position: relative; padding: 0 14px; background: var(--surface); }
.lg__reg { width: 100%; height: 46px; }
.lg__terms { margin-top: 22px; text-align: center; font-size: 12.5px; color: var(--muted); }
.lg__terms a { font-weight: 600; }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .lg { padding: 64px 14px 28px; align-items: start; }
    .lg__card { padding: 22px 18px; box-shadow: var(--shadow-sm); }
    .lg__back { left: 14px; }
    .lg__theme { right: 8px; }
    .lg__input { font-size: 16px; } /* stops iOS zooming into the field */
}
@media (max-height: 640px) { .lg { align-items: start; } }
@media (prefers-reduced-motion: reduce) { .lg__alert { animation: none; } }
.lg__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

    .lg__head .lg__logo {
        margin: 0;
    }
/* the row now owns the spacing */

.lg__home {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .875rem;
    font-weight: 500;
    color: var(--muted, #5b6b69);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 999px;
    transition: color .15s, background .15s;
}

    .lg__home:hover,
    .lg__home:focus-visible {
        color: var(--brand, #0d766e);
        background: rgba(13, 118, 110, .08);
    }