:root {
    --ink: #172033;
    --muted: #647089;
    --line: #dfe5ee;
    --surface: #ffffff;
    --background: #f4f7fb;
    --brand: #2157d5;
    --brand-dark: #173fa0;
    --success: #16794c;
    --warning: #9a6400;
    --danger: #b42318;
    --radius: 16px;
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--background); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--background); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }

.site-header { background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); font-weight: 750; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-logo { display: block; width: auto; height: 42px; object-fit: contain; }
.nav { display: flex; align-items: center; gap: 22px; font-size: 14px; font-weight: 650; }
.nav form { margin: 0; }
.nav-dropdown { position: relative; }
.nav-dropdown summary { color: var(--brand); cursor: pointer; list-style: none; }
.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown summary::after { content: "▾"; display: inline-block; margin-left: 6px; font-size: 11px; transition: transform .15s ease; }
.nav-dropdown[open] summary::after { transform: rotate(180deg); }
.nav-dropdown-menu { position: absolute; z-index: 20; top: calc(100% + 13px); right: 0; width: 190px; padding: 8px; background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 38px rgba(23, 32, 51, .14); }
.nav-dropdown-menu a { display: block; padding: 10px 12px; color: var(--ink); border-radius: 8px; }
.nav-dropdown-menu a:hover { background: #f1f4f9; text-decoration: none; }
.main-content { min-height: calc(100vh - 154px); padding-block: 48px 70px; }
.site-footer { color: var(--muted); border-top: 1px solid var(--line); padding-block: 24px; font-size: 14px; }

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(32px, 5vw, 48px); line-height: 1.06; letter-spacing: -.04em; }
h2 { margin-bottom: 8px; font-size: 24px; letter-spacing: -.025em; }
h3 { margin-bottom: 5px; font-size: 17px; }
p { line-height: 1.65; }
.muted, .form-help { color: var(--muted); }
.eyebrow { display: block; margin-bottom: 8px; color: var(--brand); font-size: 12px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }

.card, .content-section, .stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 36px rgba(27, 45, 79, .06); }
.auth-shell { min-height: 580px; display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(40px, 8vw, 100px); align-items: center; }
.auth-intro p { max-width: 580px; color: var(--muted); font-size: 18px; }
.auth-card { padding: clamp(28px, 5vw, 42px); }
.form-card { width: min(720px, 100%); padding: clamp(24px, 5vw, 40px); }
.domain-request-card { width: min(860px, 100%); }

.form-stack { display: grid; gap: 20px; }
.request-type-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.request-type-fieldset legend { margin-bottom: 12px; font-size: 14px; font-weight: 800; }
.request-type-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.request-type-option { position: relative; display: flex; gap: 12px; min-height: 148px; padding: 20px; cursor: pointer; background: #f8faff; border: 2px solid var(--line); border-radius: 14px; }
.request-type-option:has(input:checked) { background: #eef3ff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(33, 87, 213, .08); }
.request-type-option input { flex: 0 0 auto; width: 19px; min-height: 19px; margin: 2px 0 0; accent-color: var(--brand); }
.request-type-option > span { display: block; margin: 0 !important; }
.request-type-option strong { display: block; margin-bottom: 7px; font-size: 16px; }
.request-type-option small { margin: 0; line-height: 1.5; }
.transfer-fields { display: grid; gap: 20px; padding: 22px; background: #f8faff; border: 1px solid #cfd9ef; border-radius: 14px; }
.transfer-fields[hidden] { display: none; }
.transfer-explanation { padding: 15px 17px; color: #27406f; background: #eaf0ff; border-radius: 10px; }
.transfer-explanation p { margin: 5px 0 0; font-size: 14px; }
.form-stack label > span { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 700; }
input { width: 100%; min-height: 48px; padding: 11px 13px; color: var(--ink); background: white; border: 1px solid #cbd4e1; border-radius: 10px; font: inherit; }
input:focus { border-color: var(--brand); outline: 3px solid rgba(33, 87, 213, .13); }
label small { display: block; margin-top: 7px; color: var(--muted); font-size: 13px; font-weight: 400; }
.check-row { display: flex; align-items: flex-start; gap: 11px; cursor: pointer; }
.check-row input { width: 18px; min-height: 18px; margin-top: 2px; }
.check-row span { margin: 0 !important; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; padding-top: 4px; }
.form-help { margin: 22px 0 0; font-size: 13px; }
.form-message { min-height: 22px; margin-top: 10px; color: var(--muted); font-size: 13px; }
.form-message.is-danger { color: var(--danger); }
.divider { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: var(--muted); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.recovery-details { margin-top: 22px; color: var(--muted); }
.recovery-details summary { cursor: pointer; font-weight: 700; }
.compact-form { margin-top: 16px; gap: 14px; }

.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; padding: 10px 17px; border: 0; border-radius: 10px; cursor: pointer; font: inherit; font-size: 14px; font-weight: 750; }
.button:hover { text-decoration: none; }
.button-primary { color: #fff; background: var(--brand); }
.button-primary:hover { color: #fff; background: var(--brand-dark); }
.button-quiet { color: var(--ink); background: #edf1f7; }
.button-wide { width: 100%; }
.button-small { min-height: 34px; padding: 7px 12px; font-size: 13px; }

.alert { margin-bottom: 24px; padding: 14px 17px; border-radius: 11px; border: 1px solid; }
.alert-success { color: var(--success); background: #ecfdf5; border-color: #a7e8c9; }
.alert-danger { color: var(--danger); background: #fff1f0; border-color: #ffc9c4; }
.alert-warning { color: var(--warning); background: #fff8e7; border-color: #f4d58e; }

.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 28px; margin-bottom: 34px; }
.page-heading p { max-width: 650px; margin-bottom: 0; color: var(--muted); }
.compact-heading { align-items: flex-start; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 26px; }
.stat-card { padding: 22px; display: grid; gap: 3px; }
.stat-card strong { font-size: 30px; letter-spacing: -.04em; }
.stat-card span { color: var(--muted); font-size: 14px; }
.content-section { margin-top: 22px; padding: clamp(22px, 4vw, 32px); }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 22px; }
.section-heading h2 { margin: 0; }
.item-list { display: grid; gap: 12px; }
.list-item { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 17px 0; border-top: 1px solid var(--line); }
.list-item:first-child { border-top: 0; padding-top: 0; }
.list-item:last-child { padding-bottom: 0; }
.list-item p { margin: 0; color: var(--muted); font-size: 14px; }
.item-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.status { display: inline-flex; align-items: center; min-height: 28px; padding: 5px 10px; border-radius: 999px; white-space: nowrap; color: #42516b; background: #edf1f7; font-size: 12px; font-weight: 750; }
.status-paid, .status-completed, .status-active { color: var(--success); background: #e8f8f0; }
.status-awaiting_payment, .status-awaiting_backup_confirmation, .status-blocked_until_paid { color: var(--warning); background: #fff3d6; }
.status-transfer_in_progress, .status-processing, .status-provisioning, .status-ready_for_transfer { color: var(--brand); background: #eaf0ff; }
.status-registration_requested, .status-pending, .status-open { color: var(--brand); background: #eaf0ff; }
.status-late, .status-reminded, .status-partially_paid { color: var(--warning); background: #fff3d6; }
.empty-state { padding: 26px; color: var(--muted); background: #f7f9fc; border: 1px dashed #cbd4e1; border-radius: 12px; text-align: center; }
.empty-page { max-width: 680px; margin: 90px auto; text-align: center; }
.account-tabs { display: flex; gap: 6px; margin: -10px 0 24px; padding: 5px; width: fit-content; background: #e9eef6; border-radius: 12px; }
.account-tabs a { padding: 9px 14px; color: #44516a; border-radius: 8px; font-size: 14px; font-weight: 750; }
.account-tabs a:hover { text-decoration: none; background: rgba(255, 255, 255, .6); }
.account-tabs a.is-active { color: var(--ink); background: white; box-shadow: 0 2px 7px rgba(23, 32, 51, .08); }
.details-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.details-grid .content-section { margin-top: 0; }
.details-list { margin: 0; }
.details-list > div { display: grid; grid-template-columns: minmax(120px, .7fr) 1.3fr; gap: 20px; padding: 15px 0; border-top: 1px solid var(--line); }
.details-list > div:first-child { padding-top: 0; border-top: 0; }
.details-list dt { color: var(--muted); font-size: 14px; }
.details-list dd { margin: 0; font-weight: 650; line-height: 1.55; }
.contact-note { margin-top: 22px; padding: 17px 20px; color: #42516b; background: #eaf0ff; border-radius: 12px; font-size: 14px; }
.invoice-loading { padding: 32px; color: var(--muted); text-align: center; }
.invoice-table-wrap { overflow-x: auto; }
.invoice-table { width: 100%; border-collapse: collapse; }
.invoice-table th { padding: 0 12px 13px; color: var(--muted); font-size: 12px; text-align: left; text-transform: uppercase; letter-spacing: .05em; }
.invoice-table td { padding: 16px 12px; border-top: 1px solid var(--line); white-space: nowrap; }
.invoice-table th:first-child, .invoice-table td:first-child { padding-left: 0; }
.invoice-table th:last-child, .invoice-table td:last-child { padding-right: 0; }
.invoice-table .amount-column { text-align: right; font-variant-numeric: tabular-nums; }
.invoice-actions { display: flex; justify-content: flex-end; gap: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.security-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.security-grid .content-section { margin-top: 0; }
.security-card { display: flex; flex-direction: column; gap: 18px; }
.method-heading { display: grid; grid-template-columns: auto 1fr; gap: 14px; }
.method-heading p { margin: 0; }
.method-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: white; background: var(--brand); font-weight: 850; }
.credential-list { display: grid; gap: 8px; }
.credential-item { display: flex; justify-content: space-between; gap: 16px; padding: 12px; border-radius: 10px; background: #f5f7fb; }
.credential-item span { color: var(--muted); font-size: 13px; }
.security-card > label > span, .reauth-input > span { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 700; }
.security-card small { color: var(--muted); line-height: 1.5; }
.reauth-panel { margin-bottom: 22px; }
.reauth-input { display: block; max-width: 420px; }
.totp-setup img { display: block; max-width: 100%; margin: 0 auto 18px; padding: 8px; background: white; border-radius: 12px; }
.secret-code { display: block; margin: 12px 0; padding: 12px; overflow-wrap: anywhere; border-radius: 9px; background: #eef2f8; }
.recovery-panel { border-color: #8fc9ad; }
.recovery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 18px 0; }
.recovery-grid code { padding: 10px; border-radius: 8px; background: #eef8f3; text-align: center; letter-spacing: .06em; }

@media (max-width: 760px) {
    .container { width: min(100% - 28px, 1120px); }
    .header-inner { align-items: flex-start; padding-block: 16px; }
    .nav { align-items: flex-end; flex-direction: column; gap: 8px; }
    .nav > a:first-child { display: none; }
    .nav-dropdown-menu { top: 0; right: calc(100% + 10px); }
    .auth-shell { min-height: auto; grid-template-columns: 1fr; gap: 28px; }
    .auth-intro { padding-top: 18px; }
    .page-heading, .section-heading, .list-item, .item-actions { align-items: flex-start; flex-direction: column; }
    .stat-grid { grid-template-columns: 1fr; }
    .request-type-grid { grid-template-columns: 1fr; }
    .security-grid { grid-template-columns: 1fr; }
    .details-grid { grid-template-columns: 1fr; }
    .invoice-actions { align-items: stretch; flex-direction: column; }
    .recovery-grid { grid-template-columns: 1fr; }
    .item-actions { width: 100%; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions .button { width: 100%; }
}

@media print {
    .site-header, .site-footer, .button, .page-heading, .reauth-panel, .security-grid, .content-section:not(.recovery-panel) { display: none !important; }
    .recovery-panel { box-shadow: none; border: 0; }
}
