/* ==========================================================================
   NextPress Startup Hub — forms, account & utility pages (Encounter system)
   Loaded by: auth/*, hub/my/*, hub/introductions/*, hub/newsletter/*, hub/contact/*
   Reuses the custom properties defined in hub.css. Everything is scoped under
   .fx / .fx-* / .auth-* additions so it cannot leak into catalog pages.
   ========================================================================== */

/* ---- panel & split layouts ------------------------------------------------ */
.fx { padding-top: clamp(24px, 4vw, 56px); padding-bottom: clamp(72px, 9vw, 140px); }
.fx .contact-layout { grid-template-columns: minmax(0, 1fr); }
.fx .contact-form { max-width: none; }

.fx-panel { position: relative; isolation: isolate; overflow: hidden; background: var(--card); border: 1px solid var(--line-2); border-radius: calc(var(--r) + 6px); padding: clamp(24px, 4.2vw, 64px); box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 30px 60px -40px rgba(21, 17, 14, .28); }
.fx-panel::after { content: ""; position: absolute; z-index: -1; right: clamp(-90px, -5vw, -40px); top: clamp(-90px, -5vw, -40px); width: clamp(130px, 14vw, 210px); aspect-ratio: 2 / 1; pointer-events: none; opacity: .9;
    background: radial-gradient(circle at 25% 50%, rgba(255, 79, 34, .9) 0 25%, transparent 25.5%), radial-gradient(circle at 75% 50%, rgba(53, 80, 255, .9) 0 25%, transparent 25.5%); filter: blur(.2px); transform: rotate(-12deg) scale(1.6); transform-origin: 70% 30%; opacity: .16; }
.fx-panel--narrow { max-width: 760px; }

.fx-split { display: grid; grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr); gap: clamp(32px, 6vw, 110px); align-items: start; }
.fx-aside { position: sticky; top: calc(var(--hdr) + 24px); }
.fx-aside-lead { font-family: var(--f-disp); font-weight: 700; font-size: clamp(1.4rem, 2.3vw, 2.1rem); line-height: 1.55; letter-spacing: .01em; }
.fx-aside-lead em { font-family: var(--f-it); font-style: italic; font-weight: 400; color: var(--sun-ink); font-size: 1.12em; padding: 0 .08em; }
.fx-aside-list { margin-top: 28px; display: grid; gap: 0; border-top: 1px solid var(--ink); }
.fx-aside-list li { display: grid; grid-template-columns: 34px 1fr; gap: 6px; padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.8; color: var(--ink-2); }
.fx-aside-list b { font-family: var(--f-ui); font-weight: 700; font-size: 12px; letter-spacing: .12em; color: var(--sun-ink); padding-top: 3px; }
.fx-aside-list li:nth-child(even) b { color: var(--sea-ink); }

/* ---- form language -------------------------------------------------------- */
.fx-form { counter-reset: fq; }
.fx-form .form-group { margin-bottom: 30px; }
.fx-form .form-group:not(.hp-field) > label, .fx-form .form-group:not(.hp-field) > legend { display: flex; align-items: baseline; gap: 12px; font-size: 14.5px; }
.fx-form--num .form-group:not(.hp-field) > label::before, .fx-form--num .form-group:not(.hp-field) > legend::before { counter-increment: fq; content: counter(fq, decimal-leading-zero); font-family: var(--f-ui); font-weight: 700; font-size: 11.5px; letter-spacing: .12em; color: var(--sun-ink); min-width: 1.9em; }
.fx-form .required { font-family: var(--f-ui); font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; background: var(--sun); color: var(--ink); padding: 2px 9px 1px; border-radius: 99px; margin-left: 2px; }
.fx-form .required::before { content: "Required"; }
.fx-form .required { font-size: 0; }
.fx-form .required::before { font-size: 10.5px; }
.fx-form .form-note { padding-left: 0; }
.fx-form textarea { min-height: 150px; }
.fx-form textarea[rows="10"] { min-height: 260px; }
.fx-form .form-group:focus-within > label { color: var(--sea-ink); }
.fx-form .form-group > label { transition: color .3s; }
.fx-form .contact-submit, .fx-submit { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 40px; padding-top: 30px; border-top: 1px solid var(--line); }
.fx-submit .btn-solid, .fx-form .contact-submit .btn-solid { padding: 18px 40px; font-size: 15.5px; }
.fx-form > .btn-solid, .fx-submit > .btn-solid { }
.fx-fine { font-size: 12.5px; line-height: 1.9; color: var(--mute); margin: 4px 0 24px; padding: 14px 18px; background: var(--paper-2); border-radius: var(--r-sm); }
.fx-error { margin: 0 0 24px; padding: 16px 22px; border-radius: 16px; font-size: 14px; font-weight: 700; line-height: 1.7; border: 1.5px solid var(--err); background: rgba(198, 40, 40, .07); color: #9B1C1C; }
.fx-error::before { content: "!"; display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 10px; border-radius: 50%; background: var(--err); color: #fff; font-family: var(--f-ui); font-size: 13px; }
.fx-form .has-error input, .fx-form .has-error textarea { box-shadow: 0 0 0 4px rgba(198, 40, 40, .12); }

/* checkbox pills that wrap (hub.css scrolls them on mobile — forms must wrap) */
.fx .filter-checkboxes { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.fx .filter-checkbox-label { cursor: pointer; padding: 9px 18px; font-size: 14px; background: var(--paper); }
.fx .filter-checkbox input:checked + .filter-checkbox-label { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.fx .filter-checkbox input:checked + .filter-checkbox-label::before { background: var(--sun); border-color: var(--sun); }
.fx .filter-checkbox input { width: 100%; height: 100%; margin: 0; }
@media (max-width: 760px) { .fx .filter-checkboxes > * { flex: initial; } }

/* static value (party shown as fixed chip instead of a select) */
.fx-static { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-radius: 16px; background: var(--paper); border: 1.5px dashed var(--line); font-family: var(--f-disp); font-weight: 700; font-size: 1.08rem; line-height: 1.5; }
.fx-static i { flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 5px rgba(255, 79, 34, .16); }
.fx-static--c i { background: var(--sea); box-shadow: 0 0 0 5px rgba(53, 80, 255, .16); }
.fx-static small { margin-left: auto; font-family: var(--f-jp); font-weight: 500; font-size: 12.5px; color: var(--mute); }
.fx-static a { text-decoration: underline; text-decoration-color: var(--sun); text-underline-offset: 4px; text-decoration-thickness: 2px; }

/* ---- lists (tables that turn into cards on mobile) ------------------------- */
.fx-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 28px; }
.fx-table { border-collapse: separate; border-spacing: 0; }
.fx-table th { padding-top: 0; }
.fx-table td { vertical-align: middle; }
.fx-table td:first-child a { font-family: var(--f-disp); font-weight: 700; font-size: 1.08rem; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; transition: background-size .6s var(--ease), color .3s; }
.fx-table td:first-child a:hover { background-size: 100% 1.5px; color: var(--sun-ink); }
.fx-table .fx-row-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.fx-table .fx-row-actions form { display: inline-flex; }
.fx-table tbody tr.is-unread td:first-child { box-shadow: inset 3px 0 0 var(--sun); padding-left: 16px; }
.fx-table tbody tr.is-unread td { background: rgba(255, 79, 34, .045); }

.fx-pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px 4px 11px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); font-size: 12.5px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; line-height: 1.6; }
.fx-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--mute); }
.fx-pill--new { border-color: rgba(255, 79, 34, .5); color: var(--sun-ink); } .fx-pill--new::before { background: var(--sun); animation: fxPulse 2s infinite; }
.fx-pill--wait, .fx-pill--viewed { color: var(--sea-ink); border-color: rgba(53, 80, 255, .4); } .fx-pill--wait::before, .fx-pill--viewed::before { background: var(--sea); }
.fx-pill--ok, .fx-pill--accepted, .fx-pill--open { color: var(--ok); border-color: rgba(14, 122, 75, .4); } .fx-pill--ok::before, .fx-pill--accepted::before, .fx-pill--open::before { background: var(--ok); }
.fx-pill--off, .fx-pill--declined, .fx-pill--closed { color: var(--mute); } .fx-pill--off::before, .fx-pill--declined::before, .fx-pill--closed::before { background: var(--mute); opacity: .6; }
@keyframes fxPulse { 0% { box-shadow: 0 0 0 0 rgba(255, 79, 34, .55); } 70%, 100% { box-shadow: 0 0 0 8px rgba(255, 79, 34, 0); } }

.fx-dir { font-family: var(--f-ui); font-weight: 700; font-size: 12px; letter-spacing: .06em; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.fx-dir i { width: 11px; height: 11px; border-radius: 50%; background: var(--sun); } .fx-dir i + i { background: var(--sea); margin-left: -7px; mix-blend-mode: multiply; }

@media (max-width: 760px) {
    .fx-table, .fx-table tbody, .fx-table tr, .fx-table td { display: block; width: 100%; }
    .fx-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .fx-table tbody { display: grid; gap: 12px; }
    .fx-table tr { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r); padding: 18px 20px; display: grid; gap: 8px; }
    .fx-table tbody tr:hover { background: var(--card); }
    .fx-table td { padding: 0; border: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 16px; font-size: 14px; }
    .fx-table td::before { content: attr(data-label); flex: none; font-family: var(--f-ui); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }
    .fx-table td:first-child { display: block; padding-bottom: 6px; }
    .fx-table td:first-child::before, .fx-table td[data-label=""]::before { display: none; }
    .fx-table td:first-child a { font-size: 1.15rem; }
    .fx-table td:last-child { padding-top: 6px; }
    .fx-table .fx-row-actions { justify-content: flex-start; }
    .fx-table tbody tr.is-unread { border-color: rgba(255, 79, 34, .5); }
    .fx-table tbody tr.is-unread td { background: none; box-shadow: none; padding-left: 0; }
}

/* ---- empty state with actions --------------------------------------------- */
.fx-empty { text-align: center; padding: clamp(40px, 7vw, 96px) 20px; display: grid; justify-items: center; gap: 18px; background: var(--card); border: 1px dashed var(--line); border-radius: calc(var(--r) + 6px); }
.fx-empty p { max-width: 32em; font-family: var(--f-disp); font-weight: 600; font-size: clamp(1.05rem, 1.8vw, 1.35rem); line-height: 1.9; color: var(--ink-2); }
.fx-empty p a { text-decoration: underline; text-decoration-color: var(--sun); text-underline-offset: 5px; text-decoration-thickness: 2px; }
.fx-empty .fx-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.fx-orbs { position: relative; width: 74px; height: 42px; flex: none; }
.fx-orbs i { position: absolute; top: 0; width: 42px; height: 42px; border-radius: 50%; mix-blend-mode: multiply; }
.fx-orbs i:first-child { left: 0; background: var(--sun); animation: fxMeetA 1.6s var(--ease-io) both; }
.fx-orbs i:last-child { right: 0; background: var(--sea); animation: fxMeetB 1.6s var(--ease-io) both; }
.fx-orbs--lg { width: 148px; height: 84px; } .fx-orbs--lg i { width: 84px; height: 84px; }
@keyframes fxMeetA { from { transform: translateX(-90px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fxMeetB { from { transform: translateX(90px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- done / result pages --------------------------------------------------- */
.fx-done { max-width: 760px; display: grid; gap: 22px; justify-items: start; }
.fx-done p { font-size: 16px; line-height: 2; color: var(--ink-2); }
.fx-done .fx-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.fx-links { display: grid; margin-top: 8px; border-top: 1px solid var(--ink); width: 100%; }
.fx-links-h { font-family: var(--f-ui); font-weight: 700; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--mute); margin: 12px 0 0; }
.fx-links a { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 4px; border-bottom: 1px solid var(--line); font-family: var(--f-disp); font-weight: 700; font-size: 1.1rem; transition: padding .5s var(--ease), background .4s, color .3s; }
.fx-links a::after { content: "→"; font-family: var(--f-ui); transition: transform .5s var(--ease); }
.fx-links a:hover { padding-left: 16px; padding-right: 16px; background: var(--paper-2); color: var(--sun-ink); }
.fx-links a:hover::after { transform: translateX(6px); }

/* ---- introductions: letter & timeline -------------------------------------- */
.fx-letter { position: relative; background: var(--card); border: 1px solid var(--line-2); border-radius: calc(var(--r) + 6px); padding: clamp(24px, 4vw, 52px); }
.fx-letter-from { display: flex; align-items: center; gap: 14px; padding-bottom: 22px; margin-bottom: 26px; border-bottom: 1px dashed var(--line); font-size: 14px; line-height: 1.7; color: var(--mute); }
.fx-letter-from strong { display: block; color: var(--ink); font-family: var(--f-disp); font-size: 1.1rem; }
.fx-avatar { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--sun); color: var(--ink); font-family: var(--f-ui); font-weight: 800; font-size: 18px; }
.fx-avatar--c { background: var(--sea); color: #fff; }
.fx-letter .prose { font-family: var(--f-disp); font-weight: 500; font-size: clamp(1.02rem, 1.4vw, 1.2rem); line-height: 2.1; color: var(--ink); max-width: none; }
.fx-letter-need { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; color: var(--mute); }
.fx-letter-need a { color: var(--sea-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.fx-reply { margin-top: 28px; padding: 26px; border-radius: var(--r); background: var(--ink); color: var(--paper); display: grid; gap: 16px; }
.fx-reply p { font-family: var(--f-disp); font-weight: 700; font-size: 1.15rem; }
.fx-reply .fx-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.fx-reply .btn-solid { --b-bg: var(--sun); --b-fg: var(--ink); --b-bd: var(--sun); --b-fill: var(--paper); --b-fill-fg: var(--ink); }
.fx-reply .btn-line { --b-fg: var(--paper); --b-bd: rgba(243, 238, 228, .5); --b-fill: var(--paper); --b-fill-fg: var(--ink); }
.fx-steps { display: grid; gap: 0; margin: 4px 0 0; counter-reset: st; }
.fx-steps li { position: relative; padding: 0 0 22px 34px; font-size: 14px; line-height: 1.6; color: var(--mute); }
.fx-steps li::before { content: ""; position: absolute; left: 0; top: 3px; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--mute); background: var(--card); }
.fx-steps li::after { content: ""; position: absolute; left: 6.5px; top: 20px; bottom: 2px; width: 1.5px; background: var(--line); }
.fx-steps li:last-child { padding-bottom: 0; } .fx-steps li:last-child::after { display: none; }
.fx-steps li.is-done { color: var(--ink); } .fx-steps li.is-done::before { background: var(--sun); border-color: var(--sun); }
.fx-steps li.is-now::before { background: var(--sea); border-color: var(--sea); box-shadow: 0 0 0 5px rgba(53, 80, 255, .18); }
.fx-steps time, .fx-steps small { display: block; font-family: var(--f-ui); font-size: 12px; color: var(--mute); }
.fx-steps b { font-weight: 700; }
.fx-tabs { display: inline-flex; gap: 4px; padding: 5px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); }
.fx-tabs a { padding: 8px 22px; border-radius: 99px; font-size: 14px; font-weight: 700; transition: background .3s, color .3s; }
.fx-tabs a:hover { background: var(--paper-3); }
.fx-tabs a.is-on { background: var(--ink); color: var(--paper); }
.fx-tabs em { font-style: normal; font-family: var(--f-ui); font-size: 11px; margin-left: 8px; background: var(--sun); color: var(--ink); border-radius: 99px; padding: 1px 8px; }

/* ---- claim / owner status --------------------------------------------------- */
.fx-h2 { display: flex; align-items: baseline; gap: 14px; font-size: clamp(1.4rem, 2.6vw, 2.1rem); margin: 0 0 22px; }
.fx-h2 small { font-family: var(--f-ui); font-weight: 700; font-size: 12px; letter-spacing: .16em; color: var(--sun-ink); }
.fx-block + .fx-block { margin-top: clamp(48px, 7vw, 96px); }
.fx-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; max-width: 760px; }
.fx-search .form-group { margin: 0; }
.fx-results { margin-top: 28px; max-width: 760px; }
.fx-results .related-list-item { gap: 8px 18px; }
.fx-results .related-list-item > div { display: grid; gap: 2px; min-width: 0; }
.fx-results strong { font-family: var(--f-disp); font-size: 1.1rem; }
@media (max-width: 640px) { .fx-search { grid-template-columns: 1fr; } .fx-search .btn { width: 100%; } }

/* ---- responsive ------------------------------------------------------------- */
@media (max-width: 960px) {
    .fx-split { grid-template-columns: minmax(0, 1fr); }
    .fx-aside { position: static; }
}
@media (max-width: 640px) {
    .fx-panel { border-radius: var(--r); }
    .fx-form .contact-submit .btn, .fx-submit .btn { width: 100%; }
    .fx-form .contact-submit .btn-solid, .fx-submit .btn-solid { padding: 17px 24px; }
    .fx-static { flex-wrap: wrap; }
    .fx-static small { margin-left: 0; width: 100%; }
}

/* ==========================================================================
   AUTH additions (login / register)
   ========================================================================== */
.auth-panel .auth-title { font-size: clamp(2.3rem, 5vw, 4.4rem); }
.auth-panel .auth-lead { font-size: 15px; }
.auth-steps { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: -8px 0 30px; font-family: var(--f-ui); font-weight: 600; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); }
.auth-steps span { display: inline-flex; align-items: center; gap: 8px; }
.auth-steps b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: 11px; }
.auth-steps span:nth-child(2) b { background: var(--sun); color: var(--ink); } .auth-steps span:nth-child(3) b { background: var(--sea); color: #fff; }
.auth-form .form-group:focus-within > label { color: var(--sea-ink); }
.auth-form .form-group > label { transition: color .3s; }
.auth-panel fieldset legend { margin-bottom: 12px; }
.auth-panel .filter-checkboxes { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.auth-panel .filter-checkbox-label { padding: 8px 16px; font-size: 13.5px; }
.auth-panel .filter-checkbox input:checked + .filter-checkbox-label { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.auth-panel .filter-checkbox input:checked + .filter-checkbox-label::before { background: var(--sun); border-color: var(--sun); }
.auth-panel .filter-checkbox input { margin: 0; }
.auth-panel .agree { padding: 16px 18px; background: var(--paper-2); border-radius: var(--r-sm); }
.auth-panel .notice { display: flex; gap: 12px; align-items: flex-start; }
.auth-panel .notice--error::before { content: "!"; flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--err); color: #fff; font-family: var(--f-ui); font-weight: 800; font-size: 13px; margin-top: 2px; }
.auth-panel .notice--error { animation: fxShake .5s var(--ease) both; }
@keyframes fxShake { 0%, 100% { transform: none; } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

/* "link sent" state */
.auth-sent { display: grid; gap: 22px; justify-items: start; animation: heroIn 1s var(--ease) both; }
.auth-sent .fx-orbs { margin-bottom: 4px; }
.auth-sent-title { font-size: clamp(2.2rem, 4.6vw, 4rem); font-weight: 800; line-height: 1.2; }
.auth-sent-title em { font-family: var(--f-it); font-style: italic; font-weight: 400; color: var(--sun-ink); }
.auth-sent p { color: var(--ink-2); max-width: 32em; }
.auth-sent-box { width: 100%; padding: 22px 26px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line-2); display: grid; gap: 10px; font-size: 14px; line-height: 1.8; }
.auth-sent-box li { display: grid; grid-template-columns: 26px 1fr; gap: 6px; }
.auth-sent-box b { font-family: var(--f-ui); font-size: 12px; letter-spacing: .1em; color: var(--sun-ink); padding-top: 2px; }
.auth-sent details { width: 100%; border-top: 1px solid var(--line); padding-top: 18px; }
.auth-sent summary { cursor: pointer; font-weight: 700; font-size: 14px; list-style: none; display: inline-flex; gap: 10px; align-items: center; }
.auth-sent summary::-webkit-details-marker { display: none; }
.auth-sent summary::after { content: "+"; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--ink); font-family: var(--f-ui); transition: transform .4s var(--ease); }
.auth-sent details[open] summary::after { transform: rotate(45deg); }
.auth-sent details .auth-form { margin-top: 20px; }
.auth-sent .btn { width: 100%; }

/* form → "sent" transition on submit (JS adds .is-sending on the form) */
.auth-form.is-sending { opacity: .55; pointer-events: none; transition: opacity .4s; }
.auth-form.is-sending .auth-submit .btn-arrow { animation: fxSpin 1s linear infinite; }
@keyframes fxSpin { to { transform: rotate(360deg); } }

/* ---- reduced motion ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .fx-orbs i, .auth-panel .notice--error, .fx-pill--new::before, .auth-sent { animation: none !important; }
}
