:root {
    --ink: #061028;
    --ink-soft: #11194a;
    --purple: #3c1875;
    --violet: #b98cff;
    --gold: #f7b638;
    --gold-light: #ffd36c;
    --cream: #fbf8f2;
    --white: #ffffff;
    --muted: #b8bdd0;
    --line: rgba(185, 140, 255, 0.3);
    --shadow: 0 28px 80px rgba(0, 0, 0, 0.3);
}

/* Shared Cooky School emblem. */
.brand-crest {
    display: block;
    width: 3.7rem;
    height: 4.57rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    object-fit: contain;
    box-shadow: none;
}
.brand-crest::before,
.brand-crest::after { content: none; }

/* The whole brand is one fixed vector image, not separate page typography. */
.brand-lockup .cooky-logo-lockup {
    display: block;
    width: 18rem;
    height: auto;
}
@media (max-width: 620px) {
    .brand-lockup .cooky-logo-lockup { width: 13.625rem; }
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--ink);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--white);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 82% 14%, rgba(102, 42, 179, 0.5), transparent 32rem),
        radial-gradient(circle at 52% 90%, rgba(67, 26, 131, 0.35), transparent 30rem),
        var(--ink);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.55;
    background-image:
        radial-gradient(circle at 12% 20%, rgba(255, 211, 108, 0.9) 0 1px, transparent 1.7px),
        radial-gradient(circle at 66% 32%, rgba(185, 140, 255, 0.9) 0 1px, transparent 1.8px),
        radial-gradient(circle at 78% 72%, rgba(255, 211, 108, 0.8) 0 1px, transparent 1.8px),
        radial-gradient(circle at 34% 82%, rgba(185, 140, 255, 0.7) 0 1px, transparent 1.7px);
    background-size: 190px 190px, 230px 230px, 270px 270px, 310px 310px;
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}

.eyebrow {
    margin: 0 0 0.7rem;
    color: var(--gold-light);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    line-height: 1.4;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    color: var(--white);
    font-size: 0.96rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-decoration: none;
    white-space: nowrap;
}

.brand-crest {
    position: relative;
    display: grid;
    width: 3.7rem;
    height: 4.2rem;
    place-items: start center;
    padding-top: 0.22rem;
    border: 1px solid var(--gold);
    border-bottom-color: var(--violet);
    border-radius: 0.18rem 0.18rem 1rem 1rem;
    color: var(--gold-light);
    font: 2.65rem/1 Georgia, "Times New Roman", serif;
    box-shadow: 0 0 24px rgba(185, 140, 255, 0.14);
}

.brand-crest::after {
    content: "";
    position: absolute;
    right: 0.7rem;
    bottom: 0.58rem;
    left: 0.7rem;
    height: 0.55rem;
    border-top: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    transform: rotate(-7deg);
}

.brand-crest span {
    position: absolute;
    right: -0.33rem;
    bottom: -0.55rem;
    font: 0.72rem/1 system-ui, sans-serif;
}

.auth-shell {
    position: relative;
    z-index: 1;
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(0, 1.08fr) minmax(28rem, 0.92fr);
}

.auth-brand {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(2rem, 5vw, 5rem) clamp(2rem, 7vw, 8rem);
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(4, 11, 35, 0.98), rgba(4, 11, 35, 0.58)),
        radial-gradient(ellipse at 80% 52%, rgba(139, 73, 212, 0.56), transparent 48%),
        linear-gradient(135deg, #040a20, #171045 62%, #301567);
}

.auth-brand::after {
    content: "";
    position: absolute;
    width: 40rem;
    height: 40rem;
    right: 24%;
    bottom: -27rem;
    border: 1px solid rgba(255, 211, 108, 0.32);
    border-radius: 50%;
    box-shadow: 0 0 80px rgba(185, 140, 255, 0.28), inset 0 0 80px rgba(185, 140, 255, 0.16);
}

.brand-copy {
    position: relative;
    z-index: 1;
    max-width: 38rem;
    margin: auto 0;
    padding: 5rem 0;
}

.brand-copy h1,
.auth-card h2,
.setup-heading h1,
.completion-card h1,
.portal-hero h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 400;
    letter-spacing: -0.045em;
}

.brand-copy h1 {
    font-size: clamp(4rem, 7vw, 7.4rem);
    line-height: 0.88;
}

.brand-copy > p:last-child {
    max-width: 34rem;
    margin: 2rem 0 0;
    color: #d7d9e5;
    font-size: clamp(1rem, 1.45vw, 1.25rem);
    line-height: 1.75;
}

.auth-card-wrap {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 3rem;
    background: var(--cream);
}

.auth-card {
    width: min(100%, 32rem);
    padding: clamp(2rem, 4vw, 3.6rem);
    border: 1px solid rgba(70, 39, 119, 0.12);
    border-radius: 1.7rem;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 24px 75px rgba(25, 16, 55, 0.13);
}

.auth-card .eyebrow {
    color: #6f3dac;
}

.auth-card h2 {
    font-size: clamp(2.9rem, 5vw, 4.5rem);
    line-height: 1;
}

.card-intro {
    margin: 1rem 0 2rem;
    color: #626778;
    line-height: 1.65;
}

label {
    display: block;
    margin: 1.2rem 0 0.5rem;
    color: inherit;
    font-size: 0.86rem;
    font-weight: 750;
}

label span {
    color: #8d91a1;
    font-weight: 500;
}

input {
    width: 100%;
    min-height: 3.4rem;
    padding: 0.85rem 1rem;
    border: 1px solid #d9d5e1;
    border-radius: 0.75rem;
    outline: none;
    color: var(--ink);
    background: #fff;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

input:focus {
    border-color: #8450c2;
    box-shadow: 0 0 0 4px rgba(132, 80, 194, 0.13);
}

.gold-button {
    width: 100%;
    min-height: 3.75rem;
    margin-top: 1.6rem;
    padding: 0.9rem 1.25rem;
    border: 0;
    border-radius: 0.85rem;
    color: var(--ink);
    background: linear-gradient(110deg, var(--gold-light), var(--gold));
    box-shadow: 0 12px 30px rgba(217, 142, 19, 0.22);
    cursor: pointer;
    font-weight: 800;
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.gold-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 34px rgba(217, 142, 19, 0.29);
}

.button-link {
    display: inline-grid;
    width: auto;
    min-width: 15rem;
    place-items: center;
    text-decoration: none;
}

.secure-note {
    margin: 1.4rem 0 0;
    color: #858897;
    font-size: 0.78rem;
    text-align: center;
}

.secure-note span {
    margin-right: 0.35rem;
    color: #8450c2;
}

.forgot-link {
    margin: 0.75rem 0 -0.4rem;
    text-align: right;
}

.forgot-link a,
.auth-back-link a {
    color: #693aa3;
    font-size: 0.82rem;
    font-weight: 750;
    text-decoration: none;
}

.forgot-link a:hover,
.auth-back-link a:hover {
    text-decoration: underline;
}

.auth-back-link {
    margin: 1.35rem 0 0;
    text-align: center;
}

.recovery-success,
.recovery-expired {
    text-align: center;
}

.recovery-success > span,
.recovery-expired > span {
    display: grid;
    width: 4.2rem;
    height: 4.2rem;
    margin: 0 auto 1.35rem;
    place-items: center;
    border-radius: 1.3rem;
    color: #fff;
    background: linear-gradient(145deg, #8150c1, #3c1875);
    box-shadow: 0 14px 30px rgba(60, 24, 117, 0.22);
    font-size: 1.6rem;
    font-weight: 900;
}

.recovery-success > span {
    color: #173728;
    background: linear-gradient(145deg, #bcebcf, #68c894);
}

.recovery-success h2,
.recovery-expired h2 {
    font-size: clamp(2.7rem, 5vw, 4rem);
}

.recovery-success > p:not(.eyebrow),
.recovery-expired > p:not(.eyebrow) {
    color: #626778;
    line-height: 1.65;
}

.recovery-success .button-link,
.recovery-expired .button-link {
    display: grid;
    width: 100%;
    margin-top: 1.5rem;
}

.recovery-success > small {
    display: block;
    margin-top: 1rem;
    color: #858897;
    line-height: 1.5;
}

.form-message {
    margin: 1.3rem 0;
    padding: 0.9rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.88rem;
    line-height: 1.55;
}

.form-message-error {
    border: 1px solid rgba(168, 38, 59, 0.2);
    color: #8f1e34;
    background: #fff0f2;
}

.error-list ul {
    margin: 0.55rem 0 0;
    padding-left: 1.25rem;
}

.simple-header,
.portal-header {
    position: relative;
    z-index: 2;
    display: flex;
    width: min(100% - 3rem, 84rem);
    margin: 0 auto;
    align-items: center;
    justify-content: space-between;
    padding: 2rem 0;
}

.private-badge {
    padding: 0.65rem 0.9rem;
    border: 1px solid rgba(185, 140, 255, 0.45);
    border-radius: 999px;
    color: #d8baff;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.15em;
}

.setup-shell,
.portal-shell {
    position: relative;
    z-index: 1;
    width: min(100% - 3rem, 78rem);
    margin: 0 auto;
    padding: clamp(2rem, 5vw, 5rem) 0 6rem;
}

.setup-heading {
    max-width: 48rem;
    margin-bottom: 3rem;
}

.setup-heading h1,
.completion-card h1,
.portal-hero h1 {
    font-size: clamp(3rem, 6vw, 5.8rem);
    line-height: 0.98;
}

.setup-heading > p:last-child,
.completion-card > p,
.portal-hero > div > p:last-child {
    max-width: 44rem;
    color: #c4c7d5;
    font-size: 1.05rem;
    line-height: 1.7;
}

.setup-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.setup-card {
    padding: clamp(1.5rem, 3vw, 2.4rem);
    border: 1px solid var(--line);
    border-radius: 1.4rem;
    background: linear-gradient(145deg, rgba(25, 18, 69, 0.94), rgba(10, 18, 48, 0.94));
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.18);
}

.setup-card-wide {
    grid-column: 1 / -1;
}

.setup-card-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.4rem;
}

.setup-card-title .eyebrow {
    margin-bottom: 0.18rem;
}

.setup-card-title h2,
.verification-card h2 {
    margin: 0;
    font: 400 2rem/1.05 Georgia, "Times New Roman", serif;
}

.step-number,
.verification-icon {
    display: grid;
    width: 3.3rem;
    height: 3.3rem;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(185, 140, 255, 0.35);
    border-radius: 1rem;
    color: var(--gold-light);
    background: rgba(185, 140, 255, 0.08);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 1rem;
}

.field-grid.three-columns {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-full {
    grid-column: 1 / -1;
}

.setup-card input {
    border-color: rgba(185, 140, 255, 0.28);
    color: var(--white);
    background: rgba(3, 10, 32, 0.68);
}

.setup-card input:focus {
    border-color: var(--violet);
    box-shadow: 0 0 0 4px rgba(185, 140, 255, 0.12);
}

.field-help {
    margin: 0.65rem 0 0;
    color: #aeb3c7;
    font-size: 0.8rem;
    line-height: 1.55;
}

.final-setup-card .gold-button {
    max-width: 24rem;
}

.completion-card {
    max-width: 48rem;
    margin: 5vh auto 0;
    padding: clamp(2rem, 5vw, 4rem);
    border: 1px solid var(--line);
    border-radius: 1.8rem;
    text-align: center;
    background: linear-gradient(145deg, rgba(28, 17, 73, 0.96), rgba(5, 15, 42, 0.98));
    box-shadow: var(--shadow);
}

.completion-card > p {
    margin-right: auto;
    margin-left: auto;
}

.success-mark {
    display: grid;
    width: 5rem;
    height: 5rem;
    margin: 0 auto 1.5rem;
    place-items: center;
    border: 1px solid rgba(255, 211, 108, 0.52);
    border-radius: 50%;
    color: var(--gold-light);
    background: rgba(247, 182, 56, 0.1);
    font-size: 2rem;
}

.important-note {
    margin-top: 2rem;
    padding: 1rem;
    border: 1px solid rgba(255, 211, 108, 0.28);
    border-radius: 0.8rem;
    color: #e4e0d3;
    background: rgba(247, 182, 56, 0.07);
    font-size: 0.86rem;
    line-height: 1.6;
}

.important-note strong {
    display: block;
    color: var(--gold-light);
}

.outline-button {
    min-height: 2.9rem;
    padding: 0.65rem 1.15rem;
    border: 1px solid rgba(185, 140, 255, 0.7);
    border-radius: 0.7rem;
    color: var(--white);
    background: rgba(185, 140, 255, 0.06);
    cursor: pointer;
    font-weight: 700;
}

.portal-hero {
    display: flex;
    min-height: 25rem;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    padding: clamp(2rem, 5vw, 4rem);
    border: 1px solid var(--line);
    border-radius: 2rem;
    overflow: hidden;
    background:
        radial-gradient(circle at 88% 42%, rgba(128, 63, 196, 0.52), transparent 20rem),
        linear-gradient(135deg, rgba(7, 16, 47, 0.97), rgba(32, 17, 78, 0.95));
    box-shadow: var(--shadow);
}

.portal-hero > div:first-child {
    max-width: 48rem;
}

.identity-orbit {
    position: relative;
    display: grid;
    width: 14rem;
    height: 14rem;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(255, 211, 108, 0.38);
    border-radius: 50%;
    box-shadow: 0 0 0 1.6rem rgba(185, 140, 255, 0.04), 0 0 70px rgba(185, 140, 255, 0.28);
}

.identity-orbit::before {
    content: "";
    position: absolute;
    inset: 1rem;
    border: 1px dashed rgba(185, 140, 255, 0.5);
    border-radius: 50%;
}

.identity-initial {
    color: var(--gold-light);
    font: 5rem/1 Georgia, "Times New Roman", serif;
}

.identity-status {
    position: absolute;
    bottom: 1.25rem;
    padding: 0.38rem 0.65rem;
    border-radius: 999px;
    color: var(--ink);
    background: var(--gold-light);
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.12em;
}

.verification-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.verification-card {
    display: flex;
    min-height: 13rem;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.6rem;
    border: 1px solid rgba(185, 140, 255, 0.2);
    border-radius: 1.25rem;
    background: rgba(9, 17, 46, 0.82);
}

.featured-verification {
    background: linear-gradient(145deg, rgba(58, 21, 117, 0.88), rgba(12, 20, 55, 0.9));
}

.verification-card .eyebrow {
    margin-bottom: 0.35rem;
    font-size: 0.62rem;
}

.verification-card h2 {
    font-size: 1.75rem;
}

.verification-card p:last-child {
    margin: 0.75rem 0 0;
    color: #b9becf;
    font-size: 0.88rem;
    line-height: 1.6;
}

.temporary-note {
    margin: 1.4rem 0 0;
    color: #8f95aa;
    font-size: 0.75rem;
    text-align: center;
}

@media (max-width: 920px) {
    .auth-shell {
        display: block;
    }

    .auth-brand {
        min-height: 39vh;
        padding: 1.5rem;
    }

    .brand-copy {
        margin: 3rem auto 0;
        padding: 1rem 0 3rem;
        text-align: center;
    }

    .brand-copy h1 {
        font-size: clamp(3.3rem, 13vw, 5.3rem);
    }

    .brand-copy > p:last-child {
        margin: 1.4rem auto 0;
    }

    .auth-card-wrap {
        min-height: 61vh;
        padding: 2rem 1rem 3rem;
    }

    .setup-form,
    .verification-grid {
        grid-template-columns: 1fr;
    }

    .setup-card-wide {
        grid-column: auto;
    }

    .field-grid.three-columns {
        grid-template-columns: 1fr;
    }

    .portal-hero {
        min-height: auto;
    }

    .identity-orbit {
        width: 11rem;
        height: 11rem;
    }

    .identity-initial {
        font-size: 4rem;
    }
}

@media (max-width: 620px) {
    .brand-lockup {
        gap: 0.7rem;
        font-size: 0.76rem;
        letter-spacing: 0.17em;
    }

    .brand-crest {
        width: 2.9rem;
        height: 3.35rem;
        font-size: 2.1rem;
    }

    .simple-header,
    .portal-header {
        width: min(100% - 2rem, 84rem);
        padding: 1.25rem 0;
    }

    .private-badge {
        display: none;
    }

    .setup-shell,
    .portal-shell {
        width: min(100% - 2rem, 78rem);
        padding-top: 2.2rem;
    }

    .setup-heading {
        text-align: center;
    }

    .setup-heading h1,
    .completion-card h1,
    .portal-hero h1 {
        font-size: clamp(2.75rem, 13vw, 4.2rem);
    }

    .setup-card,
    .completion-card,
    .portal-hero {
        border-radius: 1.15rem;
    }

    .field-grid {
        grid-template-columns: 1fr;
    }

    .field-full {
        grid-column: auto;
    }

    .portal-header .brand-crest {
        display: none;
    }

    .portal-header .brand-lockup {
        font-size: 0.7rem;
    }

    .portal-hero {
        flex-direction: column;
        text-align: center;
    }

    .portal-hero > div > p:last-child {
        margin-right: auto;
        margin-left: auto;
    }

    .identity-orbit {
        width: 9rem;
        height: 9rem;
    }

    .identity-initial {
        font-size: 3.3rem;
    }

    .identity-status {
        bottom: 0.5rem;
    }

    .verification-card {
        min-height: auto;
    }
}

/* Keep the shared emblem identical to the public and portal versions. */
.brand-crest {
    display: block;
    width: 3.7rem;
    height: 4.57rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    object-fit: contain;
    box-shadow: none;
}
.brand-crest::before,
.brand-crest::after { content: none; }
