/* Sign-up page only. Existing app, login, backend, and auth endpoint untouched. */
:root { --ink:#1C2B48; --muted:#526B8A; --line:#8BA3C5; --tint:#C4D8E5; --tint-strong:#DCEBF5; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; color:var(--ink); background:#E8ECEF; color-scheme:light; }
* { box-sizing:border-box; }
html { min-height:100%; }
body.register-page { min-height:100vh; min-height:100svh; margin:0; overflow-x:clip; background:#E8ECEF url('../../assets/images/register-background.svg') center / cover no-repeat fixed; }
button, input, select { font:inherit; }
button { cursor:pointer; }
.register-layout { min-height:100vh; min-height:100svh; display:flex; align-items:center; justify-content:center; padding:28px 38px; }
.register-card { display:grid; grid-template-columns:39.5% minmax(0,1fr); position:relative; width:min(100%,830px); min-height:0; background:rgba(247,252,255,.93); border:1px solid rgba(255,255,255,.72); border-radius:20px; box-shadow:0 18px 38px rgba(30,65,104,.10); -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px); }
.register-welcome { border-radius:20px 0 0 20px; background:linear-gradient(155deg,#D6E8F3,#C4D8E5); border-right:1px solid #B8D2E4; display:flex; flex-direction:column; align-items:center; justify-content:flex-start; padding:49px 24px 37px; }
.welcome-copy { text-align:center; }
.welcome-copy h1 { margin:0; font-size:clamp(29px,2.8vw,37px); line-height:1.16; letter-spacing:-.035em; font-weight:750; color:#1C2B48; }
.welcome-copy p { margin:14px 0 0; color:#526B8A; font-size:15px; line-height:1.3; }
.register-house { display:block; width:min(100%,286px); height:auto; margin:auto auto 18px; max-height:255px; object-fit:contain; }
.register-content { padding:30px clamp(30px,3vw,42px) 26px; min-width:0; }
.register-content h2 { margin:0 0 24px; color:#1C2B48; font-size:29px; font-weight:750; line-height:1.2; letter-spacing:-.04em; }
.register-form { margin:0; }
.register-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:24px; row-gap:17px; }
.register-field { min-width:0; }
.register-field label { display:block; margin-bottom:5px; font-weight:700; font-size:14px; line-height:1.4; color:#1C2B48; }
.register-input { min-width:0; height:41px; display:flex; align-items:center; gap:10px; border-bottom:1px solid #8BA3C5; transition:border-color .15s ease; }
.register-input:focus-within { border-bottom:2px solid #1C2B48; }
.field-icon { display:flex; flex:0 0 22px; width:22px; height:22px; justify-content:center; align-items:center; color:#8c8e8d; }
.field-icon svg { width:22px; height:22px; }
.register-input:focus-within .field-icon { color:#1C2B48; }
.register-input input, .register-input select { display:block; min-width:0; height:100%; flex:1; padding:0; border:0; background:transparent; outline:0; color:#1C2B48; font-size:14px; }
.register-input input::placeholder { color:#999; opacity:1; }
.register-input select { appearance:none; -webkit-appearance:none; color:#60708D; cursor:pointer; }
.register-input select:valid:not([value=""]) { color:#23354D; }
.register-input select option { color:#1C2B48; }
.toggle-password { display:grid; place-items:center; flex:0 0 38px; width:38px; height:38px; padding:8px; border:0; border-radius:8px; background:transparent; color:#aaa; transition:color .16s,background .16s; }
.toggle-password:hover, .toggle-password[aria-pressed="true"] { color:#1C2B48; background:transparent; }
.toggle-password svg { width:22px; height:22px; }
.toggle-password .eye-visible { display:none; }
.toggle-password[aria-pressed="true"] .eye-visible { display:block; }
.toggle-password[aria-pressed="true"] .eye-hidden { display:none; }
.age-field { margin-top:22px; }
.preview-label { margin-left:8px; padding:2px 6px; color:#60708D; background:#C4D8E5; border-radius:4px; font-size:10px; font-weight:600; vertical-align:middle; }
/* Custom age picker: same underline treatment as the other registration fields. */
.age-picker { position:relative; min-width:0; }
.age-picker .select-input { height:44px; }
.age-picker .select-input:focus-within, .age-picker.is-open .select-input { border-bottom:2px solid #1C2B48; }
.age-picker-trigger {
    display:flex; align-items:center; gap:10px; width:100%; min-height:44px; padding:0 2px 0 0;
    border:0; background:transparent; color:#1C2B48; font:inherit; text-align:left; cursor:pointer;
}
.age-picker-trigger .field-icon { display:flex; align-items:center; flex:0 0 24px; }
.age-picker-trigger .field-icon svg { width:24px; }
.age-picker-trigger:hover .age-picker-value { color:#1C2B48; }
.age-picker-value { flex:1; min-width:0; font-size:14px; color:#60708D; }
.age-picker.has-value .age-picker-value { color:#23354D; }
.age-picker-trigger .select-arrow {
    width:18px; height:18px; flex:0 0 18px; color:#1C2B48; margin-right:3px;
    transition:transform .2s ease; pointer-events:none;
}
.age-picker-trigger[aria-expanded="true"] .select-arrow { transform:rotate(180deg); }
.age-picker-trigger:focus-visible { outline:3px solid #8EB1D1; outline-offset:4px; border-radius:3px; }
.age-picker-menu {
    position:absolute; z-index:10; top:calc(100% + 7px); left:0; right:0;
    display:flex; flex-direction:column; gap:3px; padding:6px;
    background:#EAF5FC; border:1px solid #AFCADD; border-radius:10px;
    box-shadow:0 12px 24px rgba(30,65,104,.12);
}
.age-picker-menu[hidden] { display:none; }
.age-picker-option {
    width:100%; min-height:39px; padding:9px 13px; border:0; border-radius:6px;
    background:transparent; color:#1C2B48; font:inherit; font-size:14px;
    text-align:left; cursor:pointer; transition:background-color .15s ease, color .15s ease;
}
.age-picker-option:hover, .age-picker-option:focus-visible { background:#DCEBF5; color:#1C2B48; outline:none; }
.age-picker-option[aria-selected="true"] { background:#C4D8E5; color:#1C2B48; font-weight:700; }
.age-picker-option[aria-selected="true"]:hover, .age-picker-option[aria-selected="true"]:focus-visible { background:#B7D1E5; }

.consent-panel { margin-top:18px; padding:14px 16px 12px; border:1px solid #B8D2E4; border-radius:10px; background:#EDF6FB; transition:border-color .16s ease,background .16s ease; }
.consent-panel:has(input:checked) { border-color:#1C2B48; background:#C4D8E5; }
.consent-row { display:grid; grid-template-columns:24px minmax(0,1fr) auto; gap:10px; cursor:pointer; align-items:start; }
.consent-row input { position:absolute; opacity:0; height:1px; width:1px; }
.consent-checkbox { display:grid; place-items:center; width:22px; height:22px; border-radius:3px; border:1px solid #1C2B48; background:white; margin-top:0; transition:background .18s ease; }
.consent-checkbox svg { width:17px; height:17px; color:white; opacity:0; }
.consent-row input:checked + .consent-checkbox { background:#1C2B48; }
.consent-row input:checked + .consent-checkbox svg { opacity:1; }
.consent-row input:focus-visible + .consent-checkbox { outline:3px solid #8EB1D1; outline-offset:3px; }
.consent-main { display:flex; flex-direction:column; min-width:0; gap:4px; padding-top:2px; }
.consent-heading { font-size:14px; font-weight:750; color:#1C2B48; }
.consent-description { font-size:12px; color:#526B8A; line-height:1.4; }
.consent-optional { justify-self:end; align-self:start; font-size:10px; color:#6B86A6; white-space:nowrap; margin-top:2px; }
.consent-details { display:inline-flex; align-items:center; gap:5px; margin:6px 0 0 34px; padding:4px 6px; border:0; border-radius:5px; color:#1C2B48; background:#DCEBF5; font-size:11px; font-weight:650; transition:background .18s ease,color .18s ease; }
.consent-details:hover { background:#CFE2EF; color:#1C2B48; }
.consent-details svg { height:13px; width:13px; }
.preview-info { margin:8px 0 0; font-size:11px; color:#60708D; line-height:1.45; }
.register-submit { display:block; margin:13px auto 0; width:min(100%,480px); min-height:50px; padding:9px; color:white; font-size:18px; font-weight:700; border:1px solid #1C2B48; border-radius:10px; background:#1C2B48; transition:background .2s ease,transform .2s ease,box-shadow .2s ease; }
.register-submit:hover:not(:disabled) { background:#31486A; box-shadow:0 8px 18px rgba(30,65,104,.15); transform:translateY(-1px); }
.register-submit:active:not(:disabled) { transform:translateY(0); }
.register-submit:disabled { cursor:wait; opacity:.65; }
.register-footer { text-align:center; margin:17px 0 0; color:#1C2B48; font-size:14px; line-height:1.5; }
.register-footer a { color:#1C2B48; text-decoration:none; font-weight:750; }
.register-footer a:hover { text-decoration:underline; text-underline-offset:3px; }
/* Keep the remaining paperclip positioned relative to the signup card panel. */
.register-welcome, .register-content { position:relative; isolation:isolate; }
.register-paperclip { position:absolute; top:-30px; left:30px; z-index:2; height:68px; width:45px; pointer-events:none; }
.consent-dialog { width:min(92vw,500px); max-height:85vh; padding:0; border:1px solid #B8D2E4; border-radius:14px; color:#1C2B48; background:#F4FAFD; box-shadow:0 15px 60px rgba(30,65,104,.18); }
.consent-dialog::backdrop { background:rgba(28,43,72,.28); backdrop-filter:blur(2px); }
.dialog-inner { padding:27px; position:relative; }
.dialog-inner h2 { color:#1C2B48; font-size:22px; padding-right:25px; margin:0 0 16px; }
.dialog-inner p { font-size:14px; line-height:1.6; margin:0 0 13px; }
.dialog-inner .dialog-notice { border-left:3px solid #1C2B48; padding:7px 11px; background:#C4D8E5; color:#526B8A; }
.dialog-close { position:absolute; right:14px; top:12px; display:grid; place-items:center; border:0; background:transparent; color:#60708D; width:40px; height:40px; font-size:25px; border-radius:8px; }
.dialog-close:hover { background:#DCEBF5; }
.dialog-confirm { min-height:43px; background:#1C2B48; color:white; border:0; border-radius:8px; padding:8px 25px; font-weight:700; }
.dialog-confirm:hover { background:#23354D; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible { outline:3px solid #8EB1D1; outline-offset:3px; }
.register-input input:focus-visible, .register-input select:focus-visible { outline:0; }

/* Agreements are intentionally unboxed, matching the approved NookHaven SVG. */
.agreements { margin-top:27px; min-width:0; }
.agreements-heading-row { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:0 2px 8px; border-bottom:1px solid #B8D2E4; }
.agreements-heading-row h3 { display:flex; align-items:center; gap:7px; color:#1C2B48; font-size:14px; font-weight:750; line-height:1.25; margin:0; }
.agreements-heading-row h3 svg { width:16px; height:16px; flex:0 0 16px; }
.agreements-heading-row > span { font-size:10px; color:#6B86A6; }
.agreement-row { display:grid; grid-template-columns:19px minmax(0,1fr); align-items:center; column-gap:9px; min-height:38px; padding:5px 2px; border-bottom:1px solid #C4D8E5; }
.agreement-row:last-of-type { border-bottom:0; }
.agreement-row input[type="checkbox"] { appearance:none; -webkit-appearance:none; cursor:pointer; width:18px; height:18px; margin:0; border:1px solid #1C2B48; border-radius:4px; background:#fff; position:relative; }
.agreement-row input[type="checkbox"]:checked { background:#1C2B48; border-color:#1C2B48; }
.agreement-row input[type="checkbox"]:checked::after { content:''; position:absolute; left:4px; top:0px; width:6px; height:10px; transform:rotate(45deg); border-right:2px solid #fff; border-bottom:2px solid #fff; }
.agreement-row input[type="checkbox"]:focus-visible { outline:3px solid #8EB1D1; outline-offset:3px; }
.agreement-prefix { font-size:12px; color:#1C2B48; cursor:pointer; white-space:nowrap; }
.agreement-document,.agreement-read { display:inline-flex; align-items:center; background:none; border:0; border-radius:4px; padding:5px 2px; font-size:12px; color:#1C2B48; font-weight:750; text-align:left; text-decoration:none; }
.agreement-document { justify-self:start; text-decoration:underline; text-underline-offset:2px; }
.agreement-read { justify-self:end; white-space:nowrap; }
.agreement-document:hover,.agreement-read:hover { color:#23354D; background:#DCEBF5; }
.agreement-read span { font-size:16px; vertical-align:-1px; }
.agreements .preview-info { margin:8px 2px 0; font-size:10.5px; line-height:1.5; color:#60708D; }
.agreement-dialog {
    box-sizing:border-box; padding:0; width:min(92vw,570px); max-width:92vw;
    height:min(86dvh,740px); max-height:calc(100dvh - 24px);
    overflow:hidden; /* Prevent a second scrollbar on the native dialog itself. */
    border:1px solid #B8D2E4; border-radius:16px; color:#1C2B48;
    background:#F4FAFD; box-shadow:0 18px 55px rgba(30,65,104,.16);
}
.agreement-dialog::backdrop { background:rgba(28,43,72,.30); backdrop-filter:blur(2px); }
.agreement-dialog-layout { display:flex; flex-direction:column; height:100%; min-height:0; overflow:hidden; }
.agreement-dialog-header { display:flex; flex:0 0 auto; align-items:flex-start; justify-content:space-between; gap:14px; padding:22px 24px 15px; border-bottom:1px solid #B8D2E4; }
.agreement-dialog-eyebrow { font-size:10px; color:#60708D; letter-spacing:.035em; text-transform:uppercase; margin:0 0 7px; font-weight:700; }
.agreement-dialog-header h2 { margin:0 0 7px; color:#1C2B48; font-size:24px; letter-spacing:-.03em; }
.agreement-dialog-header p:last-child { margin:0; color:#60708D; font-size:12px; line-height:1.45; }
.agreement-dialog-close { flex:0 0 38px; height:38px; width:38px; border:0; border-radius:9px; color:#1C2B48; background:transparent; font-size:25px; }
.agreement-dialog-close:hover { background:#C4D8E5; }
.agreement-dialog-body {
    flex:1 1 auto; min-height:0; padding:0;
    overflow:hidden; /* Only the document inside the frame may scroll. */
}
.agreement-document-frame { display:block; width:100%; height:100%; border:0; background:#fffefb; }
.agreement-dialog-footer { flex:0 0 auto; border-top:1px solid #B8D2E4; display:flex; gap:12px; align-items:center; justify-content:space-between; padding:14px 24px 18px; }
.agreement-dialog-footer span { color:#60708D; font-size:11px; line-height:1.4; }
.agreement-dialog-footer button { flex-shrink:0; }

/* Desktop: compact signup card with clear spacing and legible inputs.
   On tablets and phones the existing responsive layout remains in control. */
@media (min-width: 851px) {
    .register-card { grid-template-columns: 36.5% minmax(0,1fr); }
    .register-welcome { padding:36px 17px 24px; }
    .welcome-copy h1 { font-size:clamp(27px,2.5vw,33px); }
    .welcome-copy p { margin-top:10px; font-size:13px; }
    .register-house { width:min(100%,220px); max-height:205px; margin-bottom:12px; }
    .register-content { padding:22px 26px 20px; }
    .register-content h2 { font-size:26px; margin-bottom:17px; }
    .register-fields { column-gap:18px; row-gap:12px; }
    .register-field label { font-size:13px; margin-bottom:3px; }
    .register-input { height:38px; }
    .register-input input { font-size:13px; }
    .age-field { margin-top:15px; }
    .age-picker .select-input, .age-picker-trigger { min-height:40px; height:40px; }
    .consent-panel { margin-top:12px; padding:10px 12px 9px; }
    .consent-row { gap:8px; }
    .consent-main { gap:2px; }
    .consent-heading { font-size:13px; }
    .consent-description { font-size:11.5px; }
    .consent-details { margin-top:3px; }
    .agreements { margin-top:18px; }
    .agreements-heading-row { padding-bottom:6px; }
    .agreement-row { min-height:35px; padding-block:4px; }
    .agreements .preview-info { margin-top:5px; }
    .register-submit { margin-top:10px; min-height:46px; }
    .register-footer { margin-top:12px; font-size:13px; }
    .register-paperclip { width:39px; height:62px; top:-26px; }
}
@media (max-width: 1110px) {
    .register-layout { padding-inline:30px; }
    .register-fields { column-gap:14px; }
    .consent-row { grid-template-columns:24px minmax(0,1fr); }
    .consent-optional { grid-column:2; justify-self:start; margin-top:0; }
}
@media (max-width: 850px) {
    body.register-page { background-attachment:scroll; }
    .register-layout { padding:52px 24px 28px; }
    .register-card { display:block; min-height:0; max-width:600px; }
    .register-welcome { display:flex; flex-direction:row; justify-content:space-between; text-align:left; padding:26px 36px; gap:15px; border-right:0; border-bottom:1px solid #B8D2E4; border-radius:20px 20px 0 0; }
    .welcome-copy { text-align:left; }
    .welcome-copy h1 { font-size:29px; }
    .welcome-copy p { font-size:14px; margin-top:10px; }
    .desktop-break { display:none; }
    .register-house { margin:0; width:160px; height:145px; flex-shrink:0; }
    .register-content { padding:26px 32px 30px; }
    .register-content h2 { font-size:28px; margin-bottom:22px; }
}
@media (max-width: 540px) {
    .register-layout { padding:42px 14px 26px; }
    .register-card { border-radius:16px; }
    .register-welcome { padding:23px 22px 16px; border-radius:16px 16px 0 0; }
    .welcome-copy h1 { font-size:clamp(23px,6vw,28px); }
    .welcome-copy p { font-size:12px; line-height:1.45; }
    .register-house { width:105px; height:118px; }
    .register-content { padding:24px 22px 27px; }
    .register-content h2 { font-size:25px; margin-bottom:21px; }
    .register-fields { grid-template-columns:1fr; row-gap:18px; }
    .register-field label { font-size:13px; }
    .register-input { min-height:44px; }
    .register-input input, .register-input select { font-size:16px; }
    .age-picker-value, .age-picker-option { font-size:16px; }
    .age-field { margin-top:22px; }
    .consent-panel { margin-top:18px; padding:13px 12px; }
    .register-submit { min-height:52px; margin-top:15px; font-size:18px; }
    .register-footer { margin-top:21px; font-size:13px; }
    .register-paperclip { width:38px; height:58px; left:16px; top:-24px; }
}
@media (max-width: 350px) {
    .register-layout { padding-inline:10px; }
    .register-welcome { padding-inline:17px; }
    .register-house { width:81px; height:100px; }
    .register-content { padding-inline:17px; }
    .agreement-prefix,.agreement-document,.agreement-read { font-size:11px; }
    .agreement-row { column-gap:6px; }
    .agreement-row { grid-template-columns:19px minmax(0,1fr) auto; row-gap:0; padding-block:7px; }
    .agreement-row input { grid-column:1; grid-row:1 / 3; }
    .agreement-prefix { grid-column:2; grid-row:1; }
    .agreement-document { grid-column:2; grid-row:2; padding:1px 2px 3px; }
    .agreement-read { grid-column:3; grid-row:1 / 3; }
    .consent-heading { font-size:13px; }
    .consent-description { font-size:11px; }
}
@media (max-height: 820px) and (min-width: 851px) {
    .register-layout { padding-block:24px; }
    .register-card { min-height:0; }
    /* Desktop compact spacing already fits shorter viewports. */
}
@media (max-width: 540px) {
    .agreements { margin-top:24px; }
    .agreements-heading-row h3 { font-size:13px; }
    .agreement-row { min-height:44px; }
    .agreement-read,.agreement-document { min-height:34px; }
    .agreement-dialog-header { padding:18px 18px 12px; }
    .agreement-dialog-body { padding:0; }
    .agreement-dialog-footer { padding:12px 18px 15px; }
    .agreement-dialog-header h2 { font-size:21px; }
    .agreement-dialog-footer span { font-size:10px; }
}
@media (prefers-reduced-motion:reduce) {
    .register-input,.toggle-password,.consent-panel,.consent-checkbox,.consent-details,.register-submit,.age-picker-trigger .select-arrow,.age-picker-option { transition:none; }
}

/* Approved password checklist: compact, unboxed and softly muted. */
.password-requirements {
    margin-top: 8px;
    color: #60708D;
    font-size: 10.2px;
    line-height: 1.4;
    opacity: 1;
}
.password-requirements p {
    margin: 0 0 6px;
    color: #23354D;
    font-size: 10.5px;
    font-weight: 700;
}
.password-rules {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px 18px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.password-rules li {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    min-width: 0;
    overflow-wrap: anywhere;
}
.password-rules li::before {
    content: '';
    display: block;
    flex: 0 0 10px;
    width: 10px;
    height: 10px;
    margin-top: 2px;
    border-radius: 50%;
    border: 1.2px solid #9187AD;
    background: transparent;
    transition: background-color .15s ease, border-color .15s ease;
}
.password-rules li[data-met="true"] { color: #1C2B48; font-weight: 650; }
.password-rules li[data-met="true"]::before {
    content: '✓';
    color: #fff;
    font-size: 8px;
    line-height: 9px;
    text-align: center;
    background: #1C2B48;
    border-color: #1C2B48;
}
/* The sign-up emblem is a true vector SVG and should behave as decoration, not a draggable file. */
.register-house { user-select: none; -webkit-user-select: none; -webkit-user-drag: none; pointer-events: none; }
@media (min-width: 851px) {
    .password-requirements { margin-top: 7px; }
    .age-field { margin-top: 17px; }
}
@media (max-width: 540px) {
    .password-requirements { margin-top: 9px; font-size: 11px; }
    .password-requirements p { font-size: 11px; }
    .password-rules { column-gap: 9px; row-gap: 7px; }
    .age-field { margin-top: 19px; }
}
@media (prefers-reduced-motion: reduce) { .password-rules li::before { transition: none; } }


/* Three-panel signup: branding | account details | preferences & privacy.
   Uses the existing form fields, SVG assets, age selector, agreements and JS. */
.register-section-hint {
    margin: -8px 0 25px;
    font-size: 12px;
    line-height: 1.45;
    color: #718376;
}
.consent-heading-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
}
.consent-optional {
    display: inline-flex;
    align-items: center;
    width: max-content;
    max-width: 100%;
    margin: 0;
    padding: 3px 8px;
    border-radius: 999px;
    background: #DCEBF5;
    color: #1C2B48;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}
.consent-row { grid-template-columns: 22px minmax(0,1fr); gap: 10px; }
.consent-main { gap: 6px; padding-top: 1px; }
.consent-checkbox { width: 21px; height: 21px; }
.consent-details { margin-left: 31px; }

@media (min-width: 1101px) {
    .register-layout { padding: 32px 42px; }
    .register-card {
        width: min(100%, 1180px);
        min-height: 630px;
        grid-template-columns: 27% minmax(0,1fr);
    }
    .register-welcome {
        padding: 75px 24px 40px;
        justify-content: space-between;
        border-radius: 20px 0 0 20px;
    }
    .welcome-copy h1 { font-size: clamp(30px, 2.9vw, 38px); }
    .welcome-copy p { margin-top: 17px; font-size: 14px; line-height: 1.45; }
    .register-house { width: min(100%, 240px); max-height: 240px; margin: 0 auto 30px; }
    .register-paperclip { width: 43px; height: 66px; top: -26px; left: 27px; }
    .register-content { padding: 0; min-width: 0; }
    .register-form {
        display: grid;
        grid-template-columns: minmax(0, 49%) minmax(0, 51%);
        height: 100%;
        align-items: stretch;
    }
    .register-account, .register-preferences { min-width: 0; padding: 47px 31px 31px; }
    .register-account { border-right: 1px solid #B8D2E4; }
    .register-preferences { display: flex; flex-direction: column; padding-inline: 31px; }
    .register-content h2 { font-size: 26px; line-height: 1.2; margin: 0 0 16px; }
    .register-section-hint { margin: -5px 0 25px; }
    .register-fields { grid-template-columns: minmax(0,1fr); row-gap: 19px; }
    .register-field label { font-size: 13px; margin-bottom: 4px; }
    .register-input { height: 43px; }
    .register-input input { font-size: 14px; }
    .password-requirements { margin-top: 23px; font-size: 10.8px; }
    .password-rules { gap: 9px 12px; }
    .password-requirements p { margin-bottom: 11px; font-size: 11px; }
    .age-field { margin-top: 0; }
    .age-picker .select-input, .age-picker-trigger { height: 43px; min-height: 43px; }
    .consent-panel { margin-top: 27px; padding: 16px 16px 13px; }
    .consent-heading { font-size: 13.1px; }
    .consent-description { font-size: 11.8px; line-height: 1.45; }
    .consent-details { margin-top: 8px; font-size: 10.7px; }
    .agreements { margin-top: 31px; }
    .agreements-heading-row h3 { font-size: 14px; }
    .agreement-row { min-height: 47px; }
    .register-submit { width: 100%; margin-top: auto; min-height: 47px; }
    .register-footer { margin: 14px 0 0; font-size: 12.5px; }
}

/* Tablet: preserve the three logical sections while stacking branding above two columns. */
@media (min-width: 701px) and (max-width: 1100px) {
    .register-layout { padding: 43px 24px 32px; }
    .register-card { display: block; width: min(100%, 830px); min-height: 0; }
    .register-welcome {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 24px;
        padding: 25px 35px;
        border-radius: 20px 20px 0 0;
        border-right: 0;
        border-bottom: 1px solid #B8D2E4;
    }
    .welcome-copy { text-align: left; }
    .welcome-copy h1 { font-size: 29px; }
    .welcome-copy p { margin-top: 9px; font-size: 13px; }
    .register-house { width: 145px; max-height: 125px; height: 125px; margin: 0; }
    .register-content { padding: 0; }
    .register-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
    .register-account, .register-preferences { min-width: 0; padding: 30px 24px 25px; }
    .register-account { border-right: 1px solid #B8D2E4; }
    .register-preferences { display: flex; flex-direction: column; }
    .register-content h2 { font-size: 23px; margin: 0 0 13px; }
    .register-section-hint { margin: -3px 0 19px; }
    .register-fields { grid-template-columns: minmax(0,1fr); row-gap: 13px; }
    .register-input { height: 39px; }
    .password-requirements { margin-top: 18px; }
    .password-rules { column-gap: 7px; row-gap: 6px; }
    .age-field { margin-top: 0; }
    .consent-panel { margin-top: 19px; padding: 12px; }
    .consent-heading { font-size: 12px; }
    .consent-description { font-size: 11.2px; }
    .agreements { margin-top: 21px; }
    .register-submit { width: 100%; margin-top: auto; }
    .register-footer { font-size: 12px; margin-top: 12px; }
}

/* Phone: three sections become one readable column; no lost controls. */
@media (max-width: 700px) {
    .register-layout { padding: 44px 16px 24px; }
    .register-card { display: block; width: min(100%, 540px); min-height: 0; }
    .register-welcome { border-right: 0; border-bottom: 1px solid #B8D2E4; }
    .register-content { padding: 0; }
    .register-form { display: block; }
    .register-account { padding: 27px 25px 25px; border-bottom: 1px solid #B8D2E4; }
    .register-preferences { padding: 27px 25px 30px; }
    .register-content h2 { margin: 0 0 13px; font-size: 24px; }
    .register-section-hint { margin: -3px 0 20px; }
    .register-fields { grid-template-columns: 1fr; row-gap: 15px; }
    .password-requirements { margin-top: 18px; }
    .password-rules { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 10px; }
    .age-field { margin-top: 0; }
    .consent-panel { margin-top: 19px; }
    .agreements { margin-top: 25px; }
    .register-submit { width: 100%; margin-top: 17px; }
    .register-footer { margin-top: 17px; }
}
@media (max-width: 390px) {
    .register-layout { padding-inline: 11px; }
    .register-account, .register-preferences { padding-inline: 19px; }
    .register-welcome { padding: 23px 19px 17px; }
    .consent-row { grid-template-columns: 21px minmax(0,1fr); gap: 9px; }
    .consent-heading-row { gap: 6px 8px; }
    .consent-optional { font-size: 9.5px; }
    .agreement-row { column-gap: 6px; }
}

/* Agreement links are the only document-opening controls; no separate Read buttons. */
.agreement-copy { display:flex; align-items:center; flex-wrap:wrap; gap:0 8px; min-width:0; }
.agreement-document { gap:5px; min-height:34px; max-width:100%; }
.agreement-document svg { display:block; width:13px; height:13px; flex:0 0 13px; }
.agreement-document span { text-decoration:underline; text-underline-offset:2px; }
.agreement-document:hover span, .agreement-document:focus-visible span { text-decoration-thickness:2px; }
.agreement-row { grid-template-columns:19px minmax(0,1fr); }

/* Back to Login belongs outside the card and aligns to the card's left edge. */
.register-shell { width:min(100%,1180px); min-width:0; }
.register-shell .register-card { width:100%; }
.back-to-login {
    display:inline-flex; align-items:center; gap:7px; width:max-content; max-width:100%;
    min-height:34px; padding:6px 11px; margin-bottom:34px;
    border:1px solid #B8D2E4; border-radius:999px; background:#EAF5FC;
    color:#1C2B48; text-decoration:none; font-size:12px; font-weight:650; line-height:1.4;
    transition:background-color .15s ease, border-color .15s ease;
}
.back-to-login svg { height:15px; width:15px; flex:0 0 15px; }
.back-to-login:hover { background:#D6E8F3; border-color:#A7C7E7; }
@media (min-width:701px) and (max-width:1100px) { .register-shell { max-width:830px; } }
@media (max-width:700px) { .register-shell { max-width:540px; } }
@media (max-width:350px) {
    .agreement-row { grid-template-columns:19px minmax(0,1fr); row-gap:0; }
    .agreement-row input { grid-column:1; grid-row:1; }
    .agreement-copy { grid-column:2; grid-row:1; }
    .agreement-prefix, .agreement-document { grid-column:auto; grid-row:auto; }
}

/* 2026-11-06 UI refinement: slightly smaller three-panel desktop card.
   On phones, keep the same fields and real touch targets but reduce unnecessary spacing. */
@media (min-width: 1101px) {
    .register-shell { width: min(100%, 1100px); }
    .register-card { width: 100%; min-height: 596px; }
    .register-welcome { padding: 64px 21px 34px; }
    .register-house { width: min(100%, 217px); max-height: 220px; margin-bottom: 22px; }
    .register-account, .register-preferences { padding: 38px 26px 26px; }
    .register-content h2 { font-size: 24px; margin-bottom: 13px; }
    .register-section-hint { margin-bottom: 20px; }
    .register-fields { row-gap: 15px; }
    .password-requirements { margin-top: 17px; }
    .password-rules { row-gap: 7px; column-gap: 10px; }
    .consent-panel { margin-top: 21px; padding: 14px 14px 12px; }
    .agreements { margin-top: 23px; }
    .agreement-row { min-height: 43px; }
}
@media (max-width: 700px) {
    .register-layout { padding: 34px 14px 24px; }
    .register-shell { max-width: 490px; }
    .back-to-login { min-height: 38px; margin-bottom: 22px; padding: 7px 12px; }
    .register-welcome { padding: 19px 20px 14px; gap: 12px; }
    .welcome-copy h1 { font-size: clamp(22px, 5.8vw, 27px); line-height: 1.14; }
    .welcome-copy p { margin-top: 7px; font-size: 12px; line-height: 1.4; }
    .register-house { width: clamp(78px, 23vw, 111px); height: 104px; max-height: 104px; }
    .register-content h2 { font-size: 23px; margin-bottom: 11px; }
    .register-section-hint { margin: -2px 0 18px; }
    .register-account { padding: 23px 21px 24px; }
    .register-preferences { padding: 23px 21px 25px; }
    .register-fields { row-gap: 12px; }
    .register-field label { margin-bottom: 3px; }
    .register-input { height: 46px; min-height: 46px; }
    .password-requirements { margin-top: 13px; }
    .password-requirements p { margin-bottom: 5px; }
    .password-rules { gap: 6px 10px; }
    .register-preferences .register-section-hint { margin-bottom: 18px; }
    .consent-panel { margin-top: 16px; }
    .agreements { margin-top: 20px; }
    .register-submit { margin-top: 15px; min-height: 49px; }
    .register-footer { margin-top: 15px; }
}
@media (max-width: 390px) {
    .register-layout { padding-inline: 11px; }
    .register-welcome { padding: 18px 18px 14px; }
    .register-account, .register-preferences { padding-inline: 19px; }
    .register-house { width: clamp(75px, 22vw, 86px); height: 92px; }
}
@media (max-width: 350px) {
    .register-layout { padding-inline: 10px; }
    .register-welcome { padding-inline: 16px; }
    .register-account, .register-preferences { padding-inline: 17px; }
    .register-house { width: 75px; height: 86px; }
    .welcome-copy h1 { font-size: 21px; }
}
/* Keep the decorative paperclip clear of the welcome heading and Back to Login on phones. */
@media (max-width: 700px) {
    .register-paperclip { left: auto; right: 22px; top: -31px; width: 34px; height: 55px; }
}

/* Desktop placement update: the Back to Login pill sits beside the card, not over it.
   Phone styling is intentionally untouched. */
@media (min-width: 1101px) {
    .register-layout {
        align-items: flex-start;
        padding-top: clamp(28px, 8vh, 76px);
    }
    .register-shell { position: relative; }
    /* On narrower desktop screens, keep the link above to avoid overlap. */
    .back-to-login { margin-bottom: 14px; }
}
@media (min-width: 1400px) {
    .back-to-login {
        position: absolute;
        top: 16px;
        right: calc(100% + 18px);
        margin: 0;
        white-space: nowrap;
    }
}

/* Lavender design update: existing registration/consent fields and responsive structure preserved. */
.register-card { border:1px solid #B8D2E4; box-shadow:0 18px 42px rgba(30,65,104,.10); }
.register-welcome { background:linear-gradient(155deg,#D6E8F3,#C4D8E5); }
.register-content h2,.welcome-copy h1 { color:#1C2B48; }
.welcome-copy p,.register-section-hint { color:#60708D; }
.register-input { border-color:#A7C7E7; }
.consent-panel { background:#EDF6FB; border-color:#B8D2E4; }
.consent-panel:has(input:checked) { background:#D6E8F3; border-color:#8EB1D1; }

/* QA alignment correction: checkbox aligns with the first line of wrapped policy wording. */
.agreement-row{align-items:start}
.agreement-row input[type="checkbox"]{margin-top:7px}

/* Mobile QA: consent help remains scrollable and readable, including on short phones. */
.consent-dialog{max-height:min(90dvh,820px);overflow-y:auto;overscroll-behavior:contain}
.consent-dialog iframe[hidden]{display:none}
@media(max-width:540px){.consent-dialog .dialog-inner{padding:20px}.consent-dialog .dialog-inner h2{font-size:21px}}
