/* Aksh Niti — sign-in page.
 *
 * Standalone rather than an extension of portal.css: this is the first page a
 * new student ever loads, often on a slow connection, and portal.css is ~29KB
 * of dashboard shell that none of it needs. The token block below is a
 * deliberate copy of portal.css's so the two pages feel like one product —
 * if you change a colour there, change it here.
 */

:root {
    color-scheme: light;
    --bg: #f7f9fc;
    --surface: #ffffff;
    --surface-2: #f1f4f9;
    --text: #182033;
    --muted: #667085;
    --line: #dfe5ef;
    --brand: #1a73e8;
    --brand-2: #0f9d58;
    --warning: #fbbc04;
    --danger: #d93025;
    --shadow: 0 18px 50px rgba(24, 32, 51, 0.10);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #101418;
    --surface: #171b20;
    --surface-2: #20262d;
    --text: #edf2f7;
    --muted: #a9b4c2;
    --line: #2d3440;
    --brand: #8ab4f8;
    --brand-2: #81c995;
    --warning: #fdd663;
    --danger: #f28b82;
    --shadow: 0 18px 54px rgba(0, 0, 0, 0.34);
}

* {
    box-sizing: border-box;
}

/* The UA stylesheet's [hidden] { display: none } is a plain element-level rule,
   so any author `display: flex` here beats it and the element stays visible.
   Several controls on this page are flex and are toggled with .hidden = true
   (the Google button and its divider vanish in reset mode), so the attribute
   needs to actually win. */
[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    /* Mobile browsers report 100vh taller than the visible area; dvh fixes the
       card drifting under the URL bar. Declared second so old engines keep vh. */
    min-height: 100dvh;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
    background:
        radial-gradient(circle at top left, rgba(26, 115, 232, 0.12), transparent 32rem),
        linear-gradient(180deg, #fbfcff 0%, var(--bg) 100%);
    color: var(--text);
    font-family: Inter, Arial, sans-serif;
}

html[data-theme="dark"] body {
    background:
        radial-gradient(circle at top left, rgba(138, 180, 248, 0.18), transparent 32rem),
        linear-gradient(180deg, #0f1216 0%, var(--bg) 100%);
}

button,
input {
    font: inherit;
    color: inherit;
}

a {
    color: var(--brand);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ── Layout ─────────────────────────────────────────────────────────── */

.auth-page {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    min-height: 100vh;
    min-height: 100dvh;
}

.auth-aside {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
    padding: 44px 48px;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 82% 12%, rgba(255, 255, 255, 0.22), transparent 46%),
        linear-gradient(155deg, #1a73e8 0%, #1558bd 52%, #0f9d58 160%);
}

.auth-aside-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 1.16rem;
    letter-spacing: -0.01em;
}

.auth-aside-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    font-size: 1.05rem;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.26);
}

.auth-aside-copy h2 {
    margin: 0 0 14px;
    font-size: clamp(1.9rem, 2.6vw, 2.5rem);
    line-height: 1.16;
    letter-spacing: -0.025em;
    font-weight: 800;
}

.auth-aside-copy p {
    margin: 0;
    max-width: 34ch;
    font-size: 1.02rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.86);
}

.auth-points {
    display: grid;
    gap: 14px;
    margin: 26px 0 0;
    padding: 0;
    list-style: none;
}

.auth-points li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.96rem;
    color: rgba(255, 255, 255, 0.92);
}

.auth-points i {
    display: grid;
    place-items: center;
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    font-size: 0.82rem;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.auth-aside-foot {
    font-size: 0.86rem;
    color: rgba(255, 255, 255, 0.72);
}

.auth-main {
    display: grid;
    place-items: center;
    padding: 32px 24px;
}

.auth-card {
    width: 100%;
    max-width: 424px;
}

/* ── Header ─────────────────────────────────────────────────────────── */

.auth-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 28px;
}

.auth-mobile-brand {
    display: none;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.06rem;
}

.auth-mobile-brand span {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(140deg, var(--brand), #1558bd);
}

.theme-btn {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-left: auto;
    border-radius: 12px;
    cursor: pointer;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--line);
    transition: color 0.15s, border-color 0.15s;
}

.theme-btn:hover {
    color: var(--text);
    border-color: var(--brand);
}

.auth-head {
    margin-bottom: 22px;
}

.auth-head h1 {
    margin: 0 0 7px;
    font-size: 1.72rem;
    letter-spacing: -0.028em;
    font-weight: 800;
}

.auth-head p {
    margin: 0;
    color: var(--muted);
    font-size: 0.96rem;
    line-height: 1.55;
}

/* ── Alerts ─────────────────────────────────────────────────────────── */

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.auth-alert[hidden] {
    display: none;
}

.auth-alert i {
    margin-top: 2px;
    flex: none;
}

.auth-alert.is-error {
    color: var(--danger);
    background: rgba(217, 48, 37, 0.09);
    border: 1px solid rgba(217, 48, 37, 0.24);
}

.auth-alert.is-success {
    color: var(--brand-2);
    background: rgba(15, 157, 88, 0.10);
    border: 1px solid rgba(15, 157, 88, 0.26);
}

.auth-alert.is-info {
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--line);
}

/* ── Buttons ────────────────────────────────────────────────────────── */

.btn-google,
.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 13px 16px;
    border-radius: 13px;
    font-size: 0.98rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.15s, border-color 0.15s, opacity 0.15s;
}

.btn-google {
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
}

.btn-google:hover:not(:disabled) {
    border-color: var(--brand);
    box-shadow: var(--shadow);
}

.btn-google svg {
    flex: none;
    width: 19px;
    height: 19px;
}

.btn-primary {
    margin-top: 4px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), #1558bd);
    border: none;
    box-shadow: 0 10px 24px rgba(26, 115, 232, 0.26);
}

html[data-theme="dark"] .btn-primary {
    color: #0b1220;
    background: linear-gradient(135deg, #8ab4f8, #6ea3f5);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
}

.btn-google:disabled,
.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Swaps in while a request is in flight. The label is hidden rather than
   replaced so the button keeps its width and the layout doesn't jump. */
.is-busy .btn-label {
    visibility: hidden;
}

.btn-spinner {
    position: absolute;
    width: 17px;
    height: 17px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: auth-spin 0.7s linear infinite;
}

.btn-google,
.btn-primary {
    position: relative;
}

.btn-spinner[hidden] {
    display: none;
}

@keyframes auth-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .btn-spinner {
        animation-duration: 2.4s;
    }

    .btn-primary:hover:not(:disabled) {
        transform: none;
    }
}

/* ── Divider ────────────────────────────────────────────────────────── */

.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 20px 0;
    font-size: 0.82rem;
    color: var(--muted);
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

/* ── Fields ─────────────────────────────────────────────────────────── */

.auth-form {
    display: grid;
    gap: 15px;
}

.field label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
}

.field-input {
    position: relative;
    display: flex;
    align-items: center;
}

.field-input>i {
    position: absolute;
    left: 14px;
    font-size: 0.9rem;
    color: var(--muted);
    pointer-events: none;
}

.field-input input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.field-input input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

html[data-theme="dark"] .field-input input:focus {
    box-shadow: 0 0 0 3px rgba(138, 180, 248, 0.2);
}

.field-input input::placeholder {
    color: var(--muted);
    opacity: 0.75;
}

.field.has-error .field-input input {
    border-color: var(--danger);
}

.field-hint {
    margin: 6px 0 0;
    font-size: 0.8rem;
    color: var(--muted);
}

.field.has-error .field-hint {
    color: var(--danger);
}

/* "Did you mean x@gmail.com?" — login.js, for a mistyped provider. */
.field-suggest {
    margin: 8px 0 0;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--text);
    background: rgba(251, 188, 4, 0.12);
    border: 1px solid rgba(251, 188, 4, 0.5);
    overflow-wrap: anywhere;
}

.field-suggest .link-btn {
    margin-left: 2px;
}

.peek-btn {
    position: absolute;
    right: 6px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 9px;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--muted);
    background: transparent;
}

.peek-btn:hover {
    color: var(--text);
}

.field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.field-row label {
    margin-bottom: 0;
}

.link-btn {
    padding: 0;
    border: none;
    background: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--brand);
    cursor: pointer;
}

.link-btn:hover {
    text-decoration: underline;
}

/* ── Footer ─────────────────────────────────────────────────────────── */

.auth-switch {
    margin: 20px 0 0;
    text-align: center;
    font-size: 0.92rem;
    color: var(--muted);
}

.auth-legal {
    margin: 26px 0 0;
    text-align: center;
    font-size: 0.79rem;
    line-height: 1.6;
    color: var(--muted);
}

/* ── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .auth-page {
        grid-template-columns: 1fr;
    }

    .auth-aside {
        display: none;
    }

    .auth-mobile-brand {
        display: flex;
    }

    .auth-main {
        align-items: start;
        padding: 28px 20px 40px;
    }

    .auth-head h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 380px) {
    .auth-main {
        padding: 22px 16px 32px;
    }
}

/* AkashNiti circular brand mark. */
.ak-brand-mark,.auth-aside-mark,.auth-mobile-brand span {border-radius:50%;background:transparent;border:0;box-shadow:none;}
