:root {
    --bg: #f6f7fd;
    --card: #ffffff;
    --line: #e4e7f7;
    --line-soft: #eceefa;
    --ink: #26297a;
    --brand: #3b3fbb;
    --primary: #5a5fd8;
    --text: #34376a;
    --muted: #777ba8;
    --soft: #eef0fc;
    --danger: #f0506e;
    --m-happy: #fde5ab;
    --m-calm: #d5e4fb;
    --m-okay: #dcd8f6;
    --m-low: #fbd5df;
    --m-heavy: #dcdbee;
    --grad: linear-gradient(135deg, #6a6fe3, #9195f0);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

html,
body {
    height: 100%
}

body {
    font-family: 'Nunito', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased
}

a {
    color: var(--primary);
    font-weight: 800;
    text-decoration: none
}

a:hover {
    text-decoration: underline
}

button {
    font: inherit;
    border: 0;
    background: none;
    cursor: pointer;
    color: inherit
}

.icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: none
}

[hidden] {
    display: none !important
}

.sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap
}

:focus-visible {
    outline: 3px solid #aeb3ee;
    outline-offset: 2px;
    border-radius: 8px
}

.hand {
    font-family: 'Gochi Hand', cursive;
    color: var(--brand);
    line-height: 1.15;
    font-weight: 400
}

.auth {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 100vh
}

/* page background: pastel clouds + a white wave behind the form */
body {
    background: linear-gradient(160deg, #eef1fd 0%, #f1effd 45%, #f7f0fb 100%)
}

.auth {
    position: relative;
    overflow: hidden;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr)
}

.sky {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0
}

.sky .c {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px)
}

.sky .wave {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 56%
}

.sky .wave path {
    fill: #fbfbff
}

/* left: welcome panel */
.side {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 48px 28px;
    text-align: center
}

.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-top: 6vh;
    text-decoration: none !important
}

.brand .logo {
    display: flex;
    align-items: center;
    gap: 12px
}

.brand .logo svg {
    width: 92px;
    height: 74px
}

.brand .logo span {
    font-size: clamp(40px, 4.4vw, 58px);
    font-weight: 900;
    color: var(--brand);
    letter-spacing: -1px;
    line-height: 1
}

.brand .tag {
    font-size: clamp(16px, 1.6vw, 21px);
    font-weight: 700;
    color: #5b5fc8;
    margin-left: 84px
}

.side .hand.big {
    margin-top: 22px;
    font-size: clamp(22px, 2.2vw, 28px);
    color: #5b5fc8
}

.side p.lead {
    margin-top: 10px;
    max-width: 360px;
    font-size: 15.5px;
    color: var(--muted)
}

.side .ph {
    display: grid;
    place-items: center;
    text-align: center;
    width: min(250px, 62%);
    aspect-ratio: 1/1.05;
    margin-top: 22px;
    border: 2px dashed #c9ccf0;
    border-radius: 46% 46% 40% 40%;
    background: rgba(255, 255, 255, .6);
    color: #a3a6d8
}

.side .ph .icon {
    width: 34px;
    height: 34px
}

.side .ph small {
    display: block;
    margin-top: 4px;
    font-size: 12.5px;
    font-weight: 700
}

.side .hearts {
    position: relative;
    width: min(340px, 90%)
}

.side .hearts span {
    position: absolute;
    color: #a9a6f0;
    font-size: 22px
}

.corner {
    position: absolute;
    right: 28px;
    bottom: 22px;
    z-index: 1;
    font-size: 22px;
    transform: rotate(-14deg);
    color: #8c87e6;
    pointer-events: none
}

/* right: form card */
.main {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 34px 40px
}

.card {
    width: min(560px, 100%);
    padding: 36px 36px 30px;
    border-radius: 26px;
    background: #fff;
    border: 1px solid var(--line-soft);
    box-shadow: 0 24px 60px rgba(60, 64, 160, .10)
}

.back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--primary)
}

.back .icon {
    width: 18px;
    height: 18px
}

.formbox {
    width: 100%;
    margin: 20px 0 0
}

.formbox h1 {
    font-size: clamp(30px, 3vw, 38px);
    font-weight: 900;
    line-height: 1.1;
    color: var(--brand);
    letter-spacing: -.5px
}

.formbox .sub {
    margin-top: 8px;
    font-size: 16px;
    color: #6a6ea8
}

form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 26px
}

.f {
    display: flex;
    flex-direction: column;
    gap: 7px
}

.f label {
    font-size: 15px;
    font-weight: 800;
    color: var(--ink)
}

.f .row {
    display: flex;
    justify-content: space-between;
    align-items: baseline
}

.f .row a {
    font-size: 13px
}

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

.inp>.icon {
    position: absolute;
    left: 16px;
    width: 20px;
    height: 20px;
    color: #5b5fc8;
    pointer-events: none
}

.inp input {
    width: 100%;
    height: 54px;
    padding: 0 48px 0 48px;
    border: 1.5px solid #dfe2f4;
    border-radius: 14px;
    background: #f5f6fd;
    font: inherit;
    font-size: 15px;
    color: var(--text);
    outline: none;
    transition: border-color .15s, box-shadow .15s
}

.inp input:focus {
    border-color: #aeb3ee;
    box-shadow: 0 0 0 4px #eceefc;
    background: #fff
}

.inp input.invalid {
    border-color: #ef9ab0;
    box-shadow: 0 0 0 4px #fdecf1
}

.inp input[readonly] {
    background: #f6f7fd;
    color: var(--muted)
}

.eye {
    position: absolute;
    right: 9px;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #5b5fc8
}

.eye:hover {
    background: var(--soft)
}

.eye .icon {
    width: 18px;
    height: 18px
}

.hint {
    font-size: 12.5px;
    color: #9a9dc4
}

.err {
    font-size: 12.5px;
    font-weight: 700;
    color: #d0435f
}

.chk {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--text);
    cursor: pointer
}

.chk input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--primary);
    flex: none
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 54px;
    padding: 0 24px;
    border-radius: 26px;
    font-size: 16px;
    font-weight: 800;
    transition: transform .15s, box-shadow .15s;
    width: 100%
}

.btn-primary {
    background: linear-gradient(135deg, #6f74e6, #8d91ef);
    color: #fff;
    box-shadow: 0 10px 24px rgba(90, 95, 216, .28)
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(90, 95, 216, .34)
}

.btn-primary:disabled {
    opacity: .6;
    cursor: default
}

.btn-outline {
    border: 1.5px solid var(--primary);
    color: var(--brand);
    background: #fff;
    font-weight: 700
}

.btn-outline:hover {
    background: var(--soft)
}

.alert {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5
}

.alert .icon {
    width: 20px;
    height: 20px;
    flex: none;
    margin-top: 1px
}

.alert b {
    display: block;
    color: inherit
}

.alert.bad {
    background: #fdf0f3;
    color: #8a3450
}

.alert.bad .icon {
    color: #d9587a
}

.alert.info {
    background: #eef3fd;
    color: #2f5fb8
}

.alert.ok {
    background: #eef9f5;
    color: #1f6f5c
}

.alert a {
    color: inherit;
    text-decoration: underline
}

.alert[hidden] {
    display: none
}

.hotl {
    display: block;
    margin-top: 6px;
    font-size: 13px
}

.hotl a {
    white-space: nowrap
}

.divider {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    font-weight: 600;
    color: #a3a6c8
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line-soft)
}

.demo {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    border-radius: 16px;
    background: #f6f7fd;
    border: 1px dashed #d8dbf3
}

.demo b {
    font-size: 13px;
    color: var(--ink)
}

.demo small {
    font-size: 12px;
    color: var(--muted)
}

.demo .chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px
}

.demo button {
    height: 32px;
    padding: 0 12px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--line);
    font-size: 12.5px;
    font-weight: 800;
    color: var(--brand)
}

.demo button:hover {
    background: var(--soft)
}

.legal {
    margin-top: 20px;
    font-size: 13.5px;
    color: #8d91c4;
    text-align: center
}

.legal a {
    display: inline-flex;
    align-items: center;
    gap: 4px
}

.legal a .icon {
    width: 15px;
    height: 15px
}

.crisis-line {
    margin-top: 8px;
    font-size: 12px;
    color: #a3a6c8;
    text-align: center
}

.crisis-line a {
    font-weight: 800
}

.row2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap
}

.row2 a {
    font-size: 14.5px;
    font-weight: 700
}

.demo-strip {
    width: min(560px, 100%);
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 12.5px;
    color: var(--muted)
}

.demo-strip button {
    height: 30px;
    padding: 0 12px;
    border-radius: 15px;
    background: rgba(255, 255, 255, .85);
    border: 1px solid var(--line);
    font-size: 12px;
    font-weight: 800;
    color: var(--brand)
}

.demo-strip button:hover {
    background: #fff
}

/* modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    place-items: center;
    padding: 20px;
    background: rgba(38, 41, 122, .35);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px)
}

.modal.open {
    display: grid
}

.dialog {
    width: min(460px, 100%);
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 24px 10px 24px 24px;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 30px 70px rgba(38, 41, 122, .25)
}

.dialog .top {
    flex: none;
    padding-right: 14px
}

.dialog .scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 14px;
    scrollbar-width: thin;
    scrollbar-color: #cfd2f0 transparent
}

.dialog .scroll::-webkit-scrollbar {
    width: 8px
}

.dialog .scroll::-webkit-scrollbar-thumb {
    background: #cfd2f0;
    border-radius: 8px
}

.dialog .scroll::-webkit-scrollbar-track {
    background: transparent;
    margin: 4px 0
}

.dialog .top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px
}

.dialog h2 {
    font-size: 21px;
    font-weight: 900;
    color: var(--ink)
}

.dialog p {
    font-size: 14px;
    color: var(--muted)
}

.dialog h3 {
    margin: 14px 0 4px;
    font-size: 14.5px;
    font-weight: 800;
    color: var(--ink)
}

.dialog .doc p {
    color: var(--text);
    line-height: 1.6
}

.x {
    margin-left: auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--soft);
    color: var(--ink);
    flex: none
}

.sample {
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff8ec;
    font-size: 12.5px;
    color: #7a5a12
}

/* steps (register) */
.stepper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px
}

.stepper span {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 64px;
    font-size: 12.5px;
    font-weight: 800;
    color: #a3a6c8;
    text-align: center
}

.stepper span i {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-style: normal;
    background: #f1f2fa;
    color: #a3a6c8;
    font-size: 12.5px
}

.stepper span.on {
    color: var(--ink)
}

.stepper span.on i {
    background: var(--grad);
    color: #fff
}

.stepper span.done i {
    background: #dff4ec;
    color: #1f8f78
}

.stepper {
    align-items: flex-start
}

.stepper b {
    flex: 1;
    height: 2px;
    margin-top: 15px;
    background: #eceefa;
    border-radius: 1px
}

.stepper span.done+b {
    background: #bfe7d6
}

.match {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 700
}

.match .icon {
    width: 15px;
    height: 15px
}

.match.no {
    color: #d0435f
}

.match.yes {
    color: #1f8f78
}

.match[hidden] {
    display: none
}

.meter {
    height: 6px;
    border-radius: 3px;
    background: #eceefa;
    overflow: hidden
}

.meter i {
    display: block;
    height: 100%;
    width: var(--w, 0);
    background: var(--c, #d0435f);
    transition: width .2s
}

.who-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: #f6f7fd
}

.who-card .av {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--grad);
    color: #fff;
    font-weight: 900;
    flex: none
}

.who-card b {
    display: block;
    font-size: 15px;
    font-weight: 800;
    color: var(--ink)
}

.who-card small {
    display: block;
    font-size: 12.5px;
    color: var(--muted)
}

.otp {
    display: flex;
    gap: 10px;
    justify-content: space-between
}

.otp input {
    width: 100%;
    max-width: 58px;
    aspect-ratio: 1/1.12;
    border: 1.5px solid #dfe2f4;
    border-radius: 14px;
    background: #f5f6fd;
    text-align: center;
    font: inherit;
    font-size: 24px;
    font-weight: 900;
    color: var(--ink);
    outline: none;
    transition: border-color .15s, box-shadow .15s
}

.otp input:focus {
    border-color: #aeb3ee;
    box-shadow: 0 0 0 4px #eceefc;
    background: #fff
}

.otp input.filled {
    background: #fff;
    border-color: #c9ccf4
}

.otp.invalid input {
    border-color: #ef9ab0;
    box-shadow: 0 0 0 3px #fdecf1
}

.otp-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--muted)
}

.otp-meta b {
    color: var(--ink)
}

.linkbtn {
    font-weight: 800;
    color: var(--primary)
}

.linkbtn:disabled {
    color: #b3b6d8;
    cursor: default
}

.sent {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: #f6f7fd;
    font-size: 14px;
    color: var(--text)
}

.sent .ib {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: #fff;
    color: var(--primary);
    flex: none
}

.sent b {
    color: var(--ink)
}

.done-box {
    margin-top: 26px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px
}

.done-ic {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #dff4ec;
    color: #1f8f78;
    margin-bottom: 10px
}

.done-ic .icon {
    width: 36px;
    height: 36px;
    stroke-width: 2.4
}

@media (max-width:960px) {
    .auth {
        grid-template-columns: minmax(0, 1fr)
    }

    .sky .wave,
    .side,
    .corner {
        display: none
    }

    /* tablet + phone: just the form */
    .main {
        min-height: 100vh;
        padding: 24px 16px 32px
    }

    .card {
        padding: 26px 20px 22px;
        border-radius: 22px
    }
}

@media (prefers-reduced-motion:reduce) {

    .btn,
    .meter i,
    .inp input {
        transition: none
    }
}

/* Create Account: two fields side by side, the grade list, the new ID number */
.f2c {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px
}

@media (max-width: 520px) {
    .f2c {
        grid-template-columns: minmax(0, 1fr)
    }
}

.inp select {
    width: 100%;
    height: 54px;
    padding: 0 40px 0 48px;
    border: 1.5px solid #dfe2f4;
    border-radius: 14px;
    background: #f5f6fd url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b5fc8' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 16px center / 18px;
    font: inherit;
    font-size: 15px;
    color: var(--text);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s
}

.inp select:focus {
    border-color: #aeb3ee;
    box-shadow: 0 0 0 4px #eceefc;
    background-color: #fff
}

.inp select.invalid {
    border-color: #ef9ab0;
    box-shadow: 0 0 0 4px #fdecf1
}

.new-id {
    margin-top: 6px;
    padding: 14px 18px;
    border-radius: 16px;
    background: #f1f2fd;
    text-align: center
}

.new-id:empty {
    display: none
}

.new-id small {
    display: block;
    font-size: 13px;
    color: var(--muted)
}

.new-id b {
    display: block;
    font-size: 26px;
    font-weight: 900;
    letter-spacing: 1px;
    color: var(--brand, #3b3fbb)
}
