/* Sign-in pages (login, forgot, reset). Tokens only (hage-tokens.css).
   Desktop: navy brand panel + form column. Phones: brand strip above the form. */

.hg-auth {
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: var(--fs-base);
}

.hg-auth *,
.hg-auth *::before,
.hg-auth *::after {
    box-sizing: border-box;
}

.hg-auth__layout {
    display: grid;
    grid-template-columns: minmax(360px, 5fr) 7fr;
    min-height: 100vh;
}

/* ---- Brand panel (Dugsora brand kit, Web-Login) ----
   Deep Blue panel, white logo, one large Blue circle with a Periwinkle dot,
   a short message at the bottom and the app badges. Kept calm on purpose:
   no feature grid. Colours are the brand's, the same in light and dark. */
.hg-auth__brand {
    --panel-bg: #1D3FC4;          /* Deep Blue */
    --panel-shape: #2754F5;       /* Blue */
    --panel-dot: #5D7FF7;         /* Periwinkle */
    --panel-text: #DFE5FD;        /* Mist: 6.6:1 on Deep Blue */
    --panel-strong: #FFFFFF;
    --panel-line: rgba(223, 229, 253, .28);
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    gap: var(--space-10);
    padding: var(--space-10) clamp(32px, 4.5vw, 72px);
    overflow: hidden;
    background: var(--panel-bg);
    color: var(--panel-text);
}

/* Decorative circle + dot (behind the content) */
.hg-auth__shape {
    position: absolute;
    z-index: -1;
    top: 18%;
    right: -22%;
    width: min(62vh, 560px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--panel-shape);
    pointer-events: none;
}

.hg-auth__shape::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 40%;
    width: 19%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--panel-dot);
    transform: translate(-50%, -50%);
}

.hg-auth .hg-auth__logo,
.hg-auth .hg-auth__logo:hover {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--panel-strong, #FFFFFF);
    text-decoration: none;
}

.hg-auth__logo img {
    display: block;
}

.hg-auth__logo span {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.hg-auth__logo strong {
    display: block;
    font: 600 26px/1 var(--font-brand); /* Rubik: the Dugsora wordmark */
    letter-spacing: -.01em;
}

.hg-auth__pitch {
    margin-top: auto;
    max-width: 480px;
}

.hg-auth__pitch h1 {
    margin: 0 0 var(--space-4);
    color: var(--panel-strong);
    font: 700 clamp(34px, 3.4vw, 48px)/1.08 var(--font-ui);
    letter-spacing: -.03em;
}

.hg-auth__pitch p {
    margin: 0;
    color: var(--panel-text);
    font-size: var(--fs-md);
    line-height: 1.6;
}

/* Bullet list (license pages pass their own short list) */
.hg-auth__pitch ul {
    display: grid;
    gap: var(--space-3);
    margin: var(--space-6) 0 0;
    padding: 0;
    list-style: none;
}

.hg-auth__pitch li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--panel-strong);
    font-weight: 500;
}

.hg-auth__pitch li::before {
    content: "";
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    background-color: var(--panel-text);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m7.5 12 3 3 6-6'/%3E%3C/svg%3E") center / 20px no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m7.5 12 3 3 6-6'/%3E%3C/svg%3E") center / 20px no-repeat;
}

/* App badges: compact, under the message */
.hg-auth__app {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    margin-top: var(--space-8);
    padding-top: var(--space-6);
    border-top: 1px solid var(--panel-line);
}

.hg-auth .hg-auth__play {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 5px 14px 5px 10px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 9px;
    background: #000000;
    color: #FFFFFF;
    text-decoration: none;
}

.hg-auth .hg-auth__play:hover {
    border-color: rgba(255, 255, 255, .7);
    color: #FFFFFF;
    text-decoration: none;
}

.hg-auth .hg-auth__play:focus-visible {
    outline: 2px solid #FFFFFF;
    outline-offset: 3px;
}

.hg-auth__play-icon {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
}

/* App Store: not live yet, so a quiet, non-clickable badge */
.hg-auth .hg-auth__play--soon {
    border-style: dashed;
    border-color: var(--panel-line);
    background: transparent;
    color: var(--panel-text);
    cursor: default;
}

.hg-auth .hg-auth__play--soon:hover {
    border-color: var(--panel-line);
    color: var(--panel-text);
}

.hg-auth__apple {
    flex: 0 0 22px;
    font-size: 24px;
    line-height: 1;
    text-align: center;
}

.hg-auth__play-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.hg-auth__play-text small {
    font: 600 9px/1.1 var(--font-body);
    letter-spacing: .06em;
}

.hg-auth__play-text strong {
    font: 600 16px/1.15 var(--font-body);
    letter-spacing: -.01em;
}

.hg-auth__app-caption {
    flex-basis: 100%;
    color: var(--panel-text);
    font-size: var(--fs-sm);
    line-height: 1.4;
}

/* ---- Form column ---- */
.hg-auth__main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-6);
    padding: var(--space-10) var(--space-6);
}

.hg-auth__card {
    width: 100%;
    max-width: 420px;
    padding: var(--space-8);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.hg-auth__head {
    margin-bottom: var(--space-6);
}

.hg-auth__head h2 {
    margin: 0 0 6px;
    color: var(--text);
    font: 800 var(--fs-xl)/1.2 var(--font-ui);
    letter-spacing: -.01em;
}

.hg-auth__head p {
    margin: 0;
    color: var(--text-3);
    font-size: var(--fs-sm);
}

.hg-auth__form {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.hg-auth__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hg-auth__field label,
.hg-auth__label-row label {
    margin: 0;
    color: var(--text);
    font: 600 var(--fs-sm)/1.3 var(--font-ui);
}

.hg-auth__label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
}

.hg-auth a {
    color: var(--link);
    font-weight: 600;
    text-decoration: none;
}

.hg-auth a:hover {
    text-decoration: underline;
}

.hg-auth__label-row a {
    font-size: var(--fs-sm);
}

.hg-auth__input {
    position: relative;
    display: flex;
    align-items: center;
}

.hg-auth__input > .fa {
    position: absolute;
    inset-inline-start: 14px;
    color: var(--text-3);
    font-size: 15px;
    pointer-events: none;
}

.hg-auth__input input {
    width: 100%;
    min-height: var(--touch);
    padding: 10px 14px 10px 40px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: 400 var(--fs-base)/1.4 var(--font-body);
    box-shadow: var(--shadow-xs);
    transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

[dir="rtl"] .hg-auth__input input {
    padding: 10px 40px 10px 14px;
}

.hg-auth__input input::placeholder {
    color: var(--text-3);
}

.hg-auth__input input:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: var(--focus-ring);
}

.hg-auth__reveal {
    position: absolute;
    inset-inline-end: 4px;
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-3);
    cursor: pointer;
}

.hg-auth__reveal:hover {
    background: var(--surface-2);
    color: var(--text);
}

.hg-auth__reveal:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.hg-auth__input:has(.hg-auth__reveal) input {
    padding-inline-end: 44px;
}

.hg-auth__check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 32px;
    margin: 0;
    color: var(--text-2);
    font-size: var(--fs-sm);
    font-weight: 500;
    cursor: pointer;
}

.hg-auth__check input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--accent-strong);
}

.hg-auth__submit {
    min-height: var(--touch);
    margin-top: var(--space-1);
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--accent-strong);
    color: var(--accent-ink);
    font: 700 var(--fs-base)/1 var(--font-ui);
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease);
}

.hg-auth__submit:hover {
    background: color-mix(in srgb, var(--accent-strong) 88%, #000);
}

.hg-auth__submit:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.hg-auth__back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    font-size: var(--fs-sm);
}

.hg-auth__alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: var(--space-4);
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
}

.hg-auth__alert .fa {
    margin-top: 2px;
}

.hg-auth__alert--error {
    border-color: color-mix(in srgb, var(--bad) 30%, transparent);
    background: var(--bad-soft);
    color: var(--bad);
}

.hg-auth__alert--success {
    border-color: color-mix(in srgb, var(--ok) 30%, transparent);
    background: var(--ok-soft);
    color: var(--ok);
}

.hg-auth__alert--info {
    border-color: color-mix(in srgb, var(--info) 30%, transparent);
    background: var(--info-soft);
    color: var(--info);
}

/* A link that looks like the primary button (license pages) */
.hg-auth a.hg-auth__submit--link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    color: var(--accent-ink);
    text-decoration: none;
}

.hg-auth a.hg-auth__submit--link:hover {
    color: var(--accent-ink);
    text-decoration: none;
}

.hg-auth__hint {
    color: var(--text-3);
    font-size: var(--fs-xs);
}

.hg-mono,
.hg-auth__input input.hg-mono {
    font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    letter-spacing: .04em;
}

.hg-num {
    font-variant-numeric: tabular-nums;
}

/* ---- License status pages ---- */
.hg-auth__status {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: var(--space-5);
}

.hg-auth__status-icon {
    display: inline-grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
}

.hg-auth__status--bad .hg-auth__status-icon { background: var(--bad-soft); color: var(--bad); }
.hg-auth__status--warn .hg-auth__status-icon { background: var(--warn-soft); color: var(--warn); }

.hg-badge-inline {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 10px;
    border-radius: var(--radius-pill);
    font: 700 var(--fs-xs)/1 var(--font-ui);
    letter-spacing: .02em;
}

.hg-auth__status--bad .hg-badge-inline { background: var(--bad-soft); color: var(--bad); }
.hg-auth__status--warn .hg-badge-inline { background: var(--warn-soft); color: var(--warn); }

.hg-auth__head .hg-auth__so {
    margin: -2px 0 10px;
    color: var(--text-2);
    font: 600 var(--fs-md)/1.4 var(--font-ui);
}

.hg-auth__details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 0 var(--space-5);
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}

.hg-auth__form .hg-auth__details {
    margin-bottom: 0;
}

.hg-auth__details > div {
    padding: 10px 14px;
}

.hg-auth__details > div + div {
    border-inline-start: 1px solid var(--border);
}

.hg-auth__details dt {
    color: var(--text-3);
    font: 600 var(--fs-xs)/1.3 var(--font-ui);
}

.hg-auth__details dd {
    margin: 4px 0 0;
    color: var(--text);
    font: 700 var(--fs-base)/1.3 var(--font-ui);
}

.hg-auth__support {
    margin-top: var(--space-6);
    padding-top: var(--space-5);
    border-top: 1px solid var(--border);
}

.hg-auth__support-title {
    margin: 0 0 var(--space-3);
    color: var(--text);
    font: 700 var(--fs-sm)/1.3 var(--font-ui);
}

.hg-auth .hg-auth__support-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: var(--touch);
    padding: 0 12px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
}

.hg-auth .hg-auth__support-row svg {
    flex: 0 0 18px;
    color: var(--accent-strong);
}

.hg-auth .hg-auth__support-row:hover {
    border-color: var(--accent-strong);
    background: var(--accent-soft);
    text-decoration: none;
}

.hg-auth__support .hg-auth__note {
    text-align: start;
}

/* ---- Demo access ---- */
.hg-auth__demo {
    margin-top: var(--space-6);
}

.hg-auth__divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-3);
    font: 700 11px/1 var(--font-ui);
    letter-spacing: .08em;
    text-transform: uppercase;
}

.hg-auth__divider::before,
.hg-auth__divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.hg-auth__demo-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: var(--space-4);
}

.hg-auth__pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--text);
    font: 600 var(--fs-sm)/1 var(--font-ui);
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.hg-auth__pill .fa {
    color: var(--accent-strong);
}

.hg-auth__pill:hover,
.hg-auth__pill:focus-visible {
    border-color: var(--accent-strong);
    background: var(--accent-soft);
    outline: none;
}

.hg-auth__pill[disabled] {
    opacity: .6;
    cursor: progress;
}

.hg-auth__note,
.hg-auth__help {
    margin: var(--space-3) 0 0;
    color: var(--text-3);
    font-size: var(--fs-xs);
    text-align: center;
}

.hg-auth__help {
    margin-top: var(--space-6);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
}

.hg-auth__footnote {
    margin: 0;
    color: var(--text-3);
    font-size: var(--fs-xs);
}

/* ---- Tablet / phone: brand becomes a compact strip ---- */
@media (max-width: 960px) {
    .hg-auth__layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .hg-auth__brand {
        gap: 0;
        padding: var(--space-4) var(--space-5);
    }

    .hg-auth__legal,
    .hg-auth__pitch > h1,
    .hg-auth__pitch > p,
    .hg-auth__pitch > ul,
    .hg-auth__pitch > ul.hg-auth__features {
        display: none;
    }

    /* Phones and tablets keep only the app callout (students and parents
       land here first) in the brand strip */
    .hg-auth__pitch {
        max-width: none;
        margin: 0;
    }

    .hg-auth__main {
        justify-content: flex-start;
        padding: var(--space-6) var(--space-4) var(--space-8);
    }

    /* Phones and tablets: the brand panel dissolves so the sign-in form comes
       right after the logo strip and the app badges sit BELOW the form. */
    .hg-auth__layout {
        grid-template-rows: auto 1fr auto;
    }

    .hg-auth__brand,
    .hg-auth__pitch {
        display: contents;
    }

    /* The brand panel is display:contents here; its --panel-* colours still
       inherit, so the logo strip and the app strip stay Deep Blue. */
    .hg-auth .hg-auth__logo,
    .hg-auth__app {
        background: var(--panel-bg);
    }

    .hg-auth__shape {
        display: none;
    }

    .hg-auth .hg-auth__logo {
        order: 1;
        display: flex;
        padding: var(--space-4) var(--space-5);
    }

    .hg-auth__main {
        order: 2;
    }

    .hg-auth__app {
        order: 3;
        margin-top: 0;
        padding: var(--space-6) var(--space-5) var(--space-8);
        border-top: 0;
    }
}

@media (max-width: 480px) {
    .hg-auth__card {
        padding: var(--space-6) var(--space-5);
        box-shadow: var(--shadow-sm);
    }

    .hg-auth__logo strong {
        font-size: 22px;
    }
}
