:root {
    --brand: #520B57;
    --brand-dark: #3C0640;
    --brand-soft: #F4EAF5;
    --accent: #969B9F;
    --brand-contrast: #FFFFFF;
    --ink: #1D2128;
    --muted: #69717C;
    --line: #E6E8EB;
    --panel: #FFFFFF;
    --canvas: #F5F6F8;
    --success: #13795B;
    --warning: #A05A00;
    --danger: #B42318;
    --shadow: 0 18px 60px rgba(25, 26, 31, .10);
    --radius-xl: 26px;
    --radius-lg: 18px;
    --radius-md: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: var(--canvas);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

/* Public form */
.public-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 5% 0%, color-mix(in srgb, var(--brand) 10%, transparent), transparent 32rem),
        radial-gradient(circle at 100% 8%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 28rem),
        var(--canvas);
}
.public-wrap {
    width: min(1180px, calc(100% - 34px));
    margin: 0 auto;
    padding: 34px 0 52px;
}
.public-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}
.public-logo-wrap {
    display: flex;
    align-items: center;
    min-height: 72px;
}
.public-logo {
    display: block;
    max-width: 220px;
    max-height: 72px;
    width: auto;
    height: auto;
    object-fit: contain;
}
.text-logo {
    font-size: 25px;
    font-weight: 760;
    letter-spacing: -.02em;
    color: var(--brand);
}
.secure-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255,255,255,.75);
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
}
.secure-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(19,121,91,.10);
}
.hero-card {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(260px, .7fr);
    gap: 30px;
    border-radius: var(--radius-xl);
    padding: 38px 42px;
    color: var(--brand-contrast);
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    box-shadow: var(--shadow);
    margin-bottom: 26px;
}
.hero-card::after {
    content: "";
    position: absolute;
    width: 340px;
    height: 340px;
    right: -100px;
    top: -170px;
    border-radius: 50%;
    border: 46px solid color-mix(in srgb, var(--accent) 42%, transparent);
}
.hero-card h1 {
    position: relative;
    z-index: 1;
    margin: 6px 0 10px;
    font-size: clamp(31px, 4vw, 48px);
    line-height: 1.02;
    letter-spacing: -.035em;
}
.hero-card p {
    position: relative;
    z-index: 1;
    max-width: 710px;
    margin: 0;
    color: color-mix(in srgb, var(--brand-contrast) 84%, transparent);
    line-height: 1.65;
    font-size: 16px;
}
.hero-kicker {
    position: relative;
    z-index: 1;
    font-size: 12px;
    letter-spacing: .14em;
    font-weight: 800;
    text-transform: uppercase;
    opacity: .72;
}
.hero-side {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
}
.hero-summary {
    width: 100%;
    max-width: 330px;
    padding: 18px 20px;
    border: 1px solid rgba(255,255,255,.16);
    border-left: 4px solid var(--accent);
    background: rgba(255,255,255,.08);
    border-radius: 16px;
    backdrop-filter: blur(8px);
}
.hero-summary strong { display: block; margin-bottom: 6px; }
.hero-summary span { font-size: 13px; opacity: .78; line-height: 1.45; }
.form-card {
    background: var(--panel);
    border: 1px solid rgba(28,33,40,.06);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.form-section {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 34px;
    padding: 34px 40px;
    border-bottom: 1px solid var(--line);
}
.form-section:last-of-type { border-bottom: 0; }
.section-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin-bottom: 15px;
    border-radius: 10px;
    color: var(--brand);
    background: color-mix(in srgb, var(--accent) 16%, white);
    border: 1px solid color-mix(in srgb, var(--accent) 35%, white);
    font-weight: 800;
    font-size: 13px;
}
.section-copy h2 {
    margin: 0 0 8px;
    font-size: 20px;
    letter-spacing: -.02em;
}
.section-copy p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
    font-size: 14px;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}
.field.full { grid-column: 1 / -1; }
.field label {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 14px;
}
.field label .optional { color: var(--muted); font-size: 12px; font-weight: 500; }
.field input,
.field select,
.field textarea {
    width: 100%;
    border: 1px solid #D7DADF;
    border-radius: 11px;
    background: #FFF;
    color: var(--ink);
    outline: 0;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.field input, .field select { min-height: 48px; padding: 0 13px; }
.field textarea { min-height: 112px; padding: 12px 13px; resize: vertical; line-height: 1.5; }
.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 12%, transparent);
}
.field .hint { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.radio-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.radio-card {
    position: relative;
    min-width: 100px;
}
.radio-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.radio-card span {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border: 1px solid #D7DADF;
    border-radius: 11px;
    background: #FFF;
    font-weight: 700;
    color: #4D545D;
    transition: all .16s ease;
}
.radio-card input:checked + span {
    border-color: var(--brand);
    background: color-mix(in srgb, var(--brand) 8%, white);
    color: var(--brand);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 8%, transparent);
}
.known-partner {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--brand) 18%, #E6E8EB);
    background: color-mix(in srgb, var(--brand) 5%, white);
}
.known-partner-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: var(--brand-contrast);
    background: var(--brand);
    font-weight: 800;
}
.known-partner strong { display: block; font-size: 14px; }
.known-partner small { display: block; color: var(--muted); margin-top: 2px; }
.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 28px 40px 32px;
    background: #FBFBFC;
}
.form-actions-copy {
    color: var(--muted);
    font-size: 13px;
    max-width: 620px;
    line-height: 1.5;
}
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 17px;
    border: 0;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 750;
    font-size: 14px;
    transition: transform .14s ease, box-shadow .14s ease, background .14s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary {
    min-height: 50px;
    padding: 0 23px;
    color: var(--brand-contrast);
    background: var(--brand);
    box-shadow: 0 10px 24px color-mix(in srgb, var(--brand) 26%, transparent);
}
.button-primary:hover { background: var(--brand-dark); }
.button-secondary {
    color: #343A42;
    border: 1px solid #D9DCE0;
    background: #FFF;
}
.button-danger { color: white; background: var(--danger); }
.alert {
    margin: 0 0 22px;
    padding: 16px 18px;
    border-radius: 13px;
    border: 1px solid;
    line-height: 1.5;
    font-size: 14px;
}
.alert-error { color: #7A271A; background: #FFF4F2; border-color: #FECDCA; }
.alert-success { color: #075E45; background: #ECFDF3; border-color: #ABEFC6; }
.alert-info { color: #344054; background: #F8FAFC; border-color: #E4E7EC; }
.error-list { margin: 7px 0 0 18px; padding: 0; }
.public-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 4px 0;
    color: var(--muted);
    font-size: 12px;
}
.hp-field { position: absolute !important; left: -99999px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

/* Success / unavailable */
.message-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background: var(--canvas);
}
.message-card {
    width: min(680px, 100%);
    padding: 38px;
    border-radius: var(--radius-xl);
    background: #FFF;
    box-shadow: var(--shadow);
    border: 1px solid rgba(28,33,40,.06);
    text-align: center;
}
.message-card .public-logo { margin: 0 auto 28px; }
.message-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin: 0 auto 18px;
    border-radius: 18px;
    color: var(--brand-contrast);
    background: var(--brand);
    font-size: 27px;
    font-weight: 900;
}
.message-card h1 { margin: 0 0 12px; font-size: 32px; letter-spacing: -.03em; }
.message-card p { margin: 0 auto; max-width: 520px; color: var(--muted); line-height: 1.65; }
.reference-box {
    display: inline-flex;
    flex-direction: column;
    gap: 5px;
    margin: 24px 0;
    padding: 14px 22px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--brand) 7%, white);
    border: 1px solid color-mix(in srgb, var(--brand) 14%, #E8EAED);
}
.reference-box span { font-size: 11px; color: var(--muted); letter-spacing: .09em; text-transform: uppercase; font-weight: 800; }
.reference-box strong { color: var(--brand); font-size: 18px; }


@media (max-width: 980px) {
    .hero-card { grid-template-columns: 1fr; }
    .hero-side { justify-content: flex-start; }
    .form-section { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 760px) {
    .public-wrap { width: min(100% - 22px, 1180px); padding-top: 20px; }
    .public-topbar { align-items: flex-start; }
    .secure-chip { display: none; }
    .hero-card { padding: 28px 24px; border-radius: 20px; }
    .form-card { border-radius: 20px; }
    .form-section { padding: 28px 22px; }
    .form-grid { grid-template-columns: 1fr; }
    .field.full { grid-column: auto; }
    .form-actions { align-items: stretch; flex-direction: column; padding: 24px 22px; }
    .form-actions .button { width: 100%; }
    .public-footer { flex-direction: column; }
}
@media (max-width: 480px) {
    .hero-card h1 { font-size: 34px; }
    .message-card { padding: 28px 22px; }
}
.button[disabled] { opacity: .7; cursor: wait; transform: none; }
