:root {
    /* HomeGrad heritage palette preview — admin and learner sign-in */
    --hga-forest: #2f5c28;
    --hga-forest-deep: #20461c;
    --hga-green: #175676;
    --hga-lime: #ffbf00;
    --hga-cream: #f4f7f6;
    --hga-sand: #b5c7c1;
    --hga-ink: #132d3a;
    --hga-muted: #61747b;
    --hga-white: #fff;
    --hga-danger: #b42318;
    --hga-line: rgba(23, 86, 118, .15);
    --hga-shadow: 0 32px 80px rgba(16, 64, 88, .13);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--hga-cream);
}

body.hg-auth {
    min-height: 100vh;
    margin: 0;
    color: var(--hga-ink);
    background: var(--hga-cream);
    font-family: "Sora", sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.hg-auth a {
    color: inherit;
}

.hg-auth__shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(420px, 1.08fr) minmax(480px, .92fr);
}

.hg-auth__story {
    position: relative;
    display: flex;
    min-height: 100vh;
    padding: clamp(30px, 4.5vw, 72px);
    overflow: hidden;
    flex-direction: column;
    color: var(--hga-white);
    background:
        radial-gradient(circle at 78% 18%, rgba(255, 191, 0, .16), transparent 26%),
        radial-gradient(circle at 12% 82%, rgba(255, 255, 255, .08), transparent 30%),
        var(--hga-forest);
}

.hg-auth__story::after {
    position: absolute;
    right: -18%;
    bottom: -34%;
    width: min(54vw, 780px);
    aspect-ratio: 1;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 50%;
    content: "";
}

.hg-auth__story-orbit {
    position: absolute;
    border: 1px solid rgba(255, 191, 0, .18);
    border-radius: 50%;
    pointer-events: none;
}

.hg-auth__story-orbit--one {
    top: 14%;
    right: -72px;
    width: 230px;
    height: 230px;
}

.hg-auth__story-orbit--two {
    top: 22%;
    right: 6px;
    width: 74px;
    height: 74px;
    background: var(--hga-lime);
    border: 0;
    opacity: .95;
}

.hg-auth__brand {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-self: flex-start;
    text-decoration: none;
}

.hg-auth__brand-surface {
    display: inline-flex;
    width: 194px;
    min-height: 64px;
    padding: 10px 16px;
    align-items: center;
    background: var(--hga-white);
    border-radius: 18px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, .12);
}

.hg-auth__brand img {
    display: block;
    width: 100%;
    max-height: 44px;
    object-fit: contain;
}

.hg-auth__story-content {
    position: relative;
    z-index: 2;
    width: min(650px, 92%);
    margin: auto 0;
    padding: clamp(72px, 10vh, 130px) 0;
}

.hg-auth__eyebrow,
.hg-auth__form-eyebrow {
    margin: 0 0 18px;
    color: var(--hga-lime);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.hg-auth__story h1 {
    max-width: 680px;
    margin: 0;
    font-size: clamp(40px, 5vw, 76px);
    font-weight: 600;
    letter-spacing: -.055em;
    line-height: .99;
}

.hg-auth__story-copy {
    max-width: 570px;
    margin: 28px 0 0;
    color: rgba(255, 255, 255, .72);
    font-size: clamp(16px, 1.5vw, 19px);
    line-height: 1.65;
}

.hg-auth__proof {
    display: grid;
    margin-top: 38px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid rgba(255, 255, 255, .15);
}

.hg-auth__proof-item {
    min-height: 95px;
    padding: 22px 20px 12px 0;
    border-right: 1px solid rgba(255, 255, 255, .15);
}

.hg-auth__proof-item + .hg-auth__proof-item {
    padding-left: 20px;
}

.hg-auth__proof-item:last-child {
    border-right: 0;
}

.hg-auth__proof-item strong,
.hg-auth__proof-item span {
    display: block;
}

.hg-auth__proof-item strong {
    margin-bottom: 5px;
    color: var(--hga-white);
    font-size: 14px;
    font-weight: 650;
}

.hg-auth__proof-item span {
    color: rgba(255, 255, 255, .55);
    font-size: 12px;
    font-weight: 500;
}

.hg-auth__relationship {
    position: relative;
    z-index: 2;
    display: flex;
    padding-top: 22px;
    gap: 18px;
    justify-content: space-between;
    color: rgba(255, 255, 255, .52);
    border-top: 1px solid rgba(255, 255, 255, .12);
    font-size: 11px;
    font-weight: 600;
}

.hg-auth__relationship a {
    color: rgba(255, 255, 255, .8);
    text-decoration: none;
}

.hg-auth__relationship a:hover {
    color: var(--hga-lime);
}

.hg-auth__access {
    display: flex;
    min-height: 100vh;
    padding: clamp(24px, 4vw, 60px);
    flex-direction: column;
    background:
        linear-gradient(rgba(23, 86, 118, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(23, 86, 118, .035) 1px, transparent 1px),
        var(--hga-cream);
    background-size: 32px 32px;
}

.hg-auth__access-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hg-auth__mobile-brand {
    display: none;
}

.hg-auth__back,
.hg-auth__secure {
    display: inline-flex;
    min-height: 42px;
    gap: 8px;
    align-items: center;
    color: var(--hga-muted);
    font-size: 12px;
    font-weight: 650;
    text-decoration: none;
}

.hg-auth__back svg,
.hg-auth__secure svg {
    width: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.hg-auth__back:hover {
    color: var(--hga-green);
}

.hg-auth__secure {
    color: var(--hga-green);
}

.hg-auth__panel {
    width: min(100%, 520px);
    margin: auto;
    padding: clamp(36px, 5vw, 62px);
    background: rgba(255, 255, 255, .94);
    border: 1px solid var(--hga-line);
    border-radius: 28px;
    box-shadow: var(--hga-shadow);
}

.hg-auth--register .hg-auth__panel {
    width: min(100%, 720px);
}

.hg-auth--register .hg-auth__access {
    overflow-y: auto;
}

.hg-auth__grid,
.hg-auth__phone-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hg-auth__phone-grid {
    grid-template-columns: minmax(110px, .34fr) minmax(0, 1fr);
}

.hg-auth__strength {
    height: 4px;
    margin-top: 9px;
    overflow: hidden;
    background: var(--hga-sand);
    border-radius: 99px;
}

.hg-auth__strength span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    transition: width .2s ease, background-color .2s ease;
}

.hg-auth__strength-label {
    display: block;
    min-height: 17px;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 650;
}

.hg-auth__terms {
    margin: 0 0 22px;
    color: var(--hga-muted);
    font-size: 12px;
    line-height: 1.65;
}

.hg-auth__captcha {
    padding: 16px;
    background: var(--hga-cream);
    border: 1px solid var(--hga-line);
    border-radius: 14px;
}

.hg-auth__form-eyebrow {
    color: var(--hga-green);
}

.hg-auth__panel h2 {
    margin: 0;
    color: var(--hga-ink);
    font-size: clamp(30px, 3vw, 44px);
    font-weight: 600;
    letter-spacing: -.045em;
    line-height: 1.08;
}

.hg-auth__form-intro {
    margin: 16px 0 32px;
    color: var(--hga-muted);
    font-size: 14px;
    line-height: 1.7;
}

.hg-auth__notice {
    padding: 13px 15px;
    margin-bottom: 24px;
    color: var(--hga-forest);
    background: rgba(255, 191, 0, .34);
    border: 1px solid rgba(23, 86, 118, .2);
    border-radius: 13px;
    font-size: 13px;
    font-weight: 600;
}

.hg-auth__field {
    margin-bottom: 20px;
}

.hg-auth__label {
    display: flex;
    margin-bottom: 9px;
    align-items: center;
    justify-content: space-between;
    color: var(--hga-ink);
    font-size: 13px;
    font-weight: 650;
}

.hg-auth__control-wrap {
    position: relative;
}

.hg-auth__control {
    width: 100%;
    min-height: 54px;
    padding: 14px 16px;
    color: var(--hga-ink);
    background: var(--hga-white);
    border: 1px solid rgba(23, 86, 118, .18);
    border-radius: 14px;
    font: inherit;
    font-size: 14px;
    outline: 0;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.hg-auth__control::placeholder {
    color: #909a93;
}

.hg-auth__control:hover {
    border-color: rgba(23, 86, 118, .48);
}

.hg-auth__control:focus {
    border-color: var(--hga-green);
    box-shadow: 0 0 0 4px rgba(23, 86, 118, .13);
}

.hg-auth__control[aria-invalid="true"] {
    border-color: var(--hga-danger);
}

.hg-auth__control--password {
    padding-right: 56px;
}

.hg-auth__password-toggle {
    position: absolute;
    top: 7px;
    right: 7px;
    display: grid;
    width: 40px;
    height: 40px;
    padding: 0;
    color: var(--hga-muted);
    background: var(--hga-cream);
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    place-items: center;
}

.hg-auth__password-toggle:hover {
    color: var(--hga-forest);
    background: var(--hga-lime);
}

.hg-auth__password-toggle svg {
    width: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.hg-auth__error {
    display: block;
    margin-top: 7px;
    color: var(--hga-danger);
    font-size: 12px;
    font-weight: 600;
}

.hg-auth__options {
    display: flex;
    margin: 3px 0 26px;
    gap: 18px;
    align-items: center;
    justify-content: space-between;
}

.hg-auth__remember {
    display: inline-flex;
    gap: 9px;
    align-items: center;
    color: var(--hga-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.hg-auth__remember input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--hga-green);
}

.hg-auth__text-link {
    color: var(--hga-green);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.hg-auth__text-link:hover {
    color: var(--hga-forest);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.hg-auth__submit {
    display: inline-flex;
    width: 100%;
    min-height: 54px;
    padding: 13px 20px;
    gap: 10px;
    align-items: center;
    justify-content: center;
    color: var(--hga-white);
    background: var(--hga-forest);
    border: 1px solid var(--hga-forest);
    border-radius: 14px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.hg-auth__submit:hover {
    color: var(--hga-forest);
    background: var(--hga-lime);
    border-color: var(--hga-lime);
    box-shadow: 0 14px 26px rgba(23, 86, 118, .16);
    transform: translateY(-1px);
}

.hg-auth__submit svg {
    width: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.hg-auth__alternate,
.hg-auth__security-note {
    margin: 24px 0 0;
    color: var(--hga-muted);
    font-size: 12px;
    font-weight: 550;
    text-align: center;
}

.hg-auth__security-note {
    padding-top: 20px;
    border-top: 1px solid var(--hga-line);
    line-height: 1.65;
}

.hg-auth__legal {
    margin: auto auto 0;
    padding-top: 28px;
    color: var(--hga-muted);
    font-size: 11px;
    font-weight: 550;
    text-align: center;
}

.hg-auth--admin .hg-auth__story {
    background:
        linear-gradient(145deg, rgba(32, 70, 28, .98), rgba(47, 92, 40, .94)),
        var(--hga-forest);
}

.hg-auth--admin .hg-auth__story-orbit--two {
    width: 58px;
    height: 58px;
}

.hg-auth--admin .hg-auth__panel {
    border-top: 5px solid var(--hga-lime);
}

.g-recaptcha {
    margin: 0 0 22px;
    overflow: hidden;
}

.hg-auth a:focus-visible,
.hg-auth button:focus-visible,
.hg-auth input:focus-visible {
    outline: 3px solid rgba(255, 191, 0, .88);
    outline-offset: 3px;
}

@media (max-width: 980px) {
    .hg-auth__shell {
        grid-template-columns: 1fr;
    }

    .hg-auth__story {
        order: 2;
        min-height: auto;
        padding: 26px;
    }

    .hg-auth__access {
        order: 1;
    }

    .hg-auth__mobile-brand {
        display: inline-flex;
        width: 142px;
        min-height: 48px;
        padding: 7px 12px;
        align-items: center;
        justify-content: center;
        background: #fff;
        border-radius: 13px;
        box-shadow: 0 8px 20px rgba(16, 64, 88, .08);
    }

    .hg-auth__mobile-brand img {
        display: block;
        width: 100%;
        max-height: 34px;
        object-fit: contain;
    }

    .hg-auth__story-content {
        width: 100%;
        padding: 70px 0 42px;
    }

    .hg-auth__story h1 {
        max-width: 700px;
        font-size: clamp(38px, 8vw, 64px);
    }

    .hg-auth__relationship {
        flex-wrap: wrap;
    }

    .hg-auth__access {
        min-height: auto;
        padding: 28px 22px 40px;
    }

    .hg-auth__panel {
        margin: 70px auto;
    }
}

@media (max-width: 600px) {
    .hg-auth__story {
        padding: 20px;
    }

    .hg-auth__brand-surface {
        width: 164px;
        min-height: 56px;
    }

    .hg-auth__story-content {
        padding: 52px 0 30px;
    }

    .hg-auth__story h1 {
        font-size: clamp(34px, 11vw, 48px);
    }

    .hg-auth__story-copy {
        font-size: 15px;
    }

    .hg-auth__proof {
        grid-template-columns: 1fr;
    }

    .hg-auth__proof-item,
    .hg-auth__proof-item + .hg-auth__proof-item {
        min-height: auto;
        padding: 15px 0;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, .12);
    }

    .hg-auth__proof-item:last-child {
        border-bottom: 0;
    }

    .hg-auth__relationship span:first-child,
    .hg-auth__secure {
        display: none;
    }

    .hg-auth__mobile-brand {
        width: 128px;
    }

    .hg-auth__access {
        padding: 20px 16px 32px;
    }

    .hg-auth__panel {
        padding: 30px 22px;
        margin: 42px auto;
        border-radius: 22px;
    }

    .hg-auth__options {
        align-items: flex-start;
    }

    .hg-auth__grid,
    .hg-auth__phone-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .hg-auth__captcha {
        padding: 12px;
        overflow-x: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
