:root {
    color-scheme: light;
    --ink: #172033;
    --muted: #637083;
    --line: #dbe2ea;
    --surface: #ffffff;
    --background: #f4f7fb;
    --brand: #0b3e86;
    --brand-dark: #082e65;
    --accent: #ed7d31;
    --button: #ed7d31;
    --button-dark: #cf651f;
    --button-soft: #fff1e8;
    --ready: #137333;
    --ready-bg: #e8f5ec;
    --attention: #8a4b08;
    --attention-bg: #fff2df;
    --offline: #9b1c1c;
    --offline-bg: #fdebec;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at top right, rgba(237, 125, 49, 0.12), transparent 24rem),
        var(--background);
}

a {
    color: var(--brand);
}

.site-header,
.site-footer,
.page-shell {
    width: min(1120px, calc(100% - 32px));
    margin-inline: auto;
}

.site-header {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.header-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
}

.brand-mark {
    display: block;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    overflow: hidden;
    border-radius: 14px;
    background: var(--accent);
    box-shadow: 0 6px 16px rgba(237, 125, 49, 0.24);
}

.brand-mark img {
    display: block;
    width: 48px;
    height: auto;
}

.page-shell {
    min-height: calc(100vh - 148px);
    padding-block: 48px 72px;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-block: 22px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 14px;
}

.hero {
    max-width: 760px;
    padding-top: clamp(24px, 7vw, 96px);
}

h1 {
    max-width: 820px;
    margin: 8px 0 18px;
    font-size: clamp(36px, 7vw, 68px);
    line-height: 1.02;
    letter-spacing: -0.04em;
}

.eyebrow {
    margin: 0;
    color: var(--accent);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.lead,
.location {
    color: var(--muted);
    font-size: clamp(17px, 2.3vw, 21px);
    line-height: 1.6;
}

.lead.compact {
    font-size: 16px;
}

.notice,
.status-panel {
    margin-top: 28px;
    padding: 20px 22px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: 12px;
    background: var(--surface);
    line-height: 1.5;
}

.kiosk-card,
.form-card,
.customer-shell,
.document-shell,
.settings-shell,
.legal-card {
    max-width: 760px;
    margin: 24px auto;
    padding: clamp(24px, 6vw, 54px);
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: 0 20px 60px rgba(23, 32, 51, 0.08);
}

.kiosk-card h1,
.form-card h1,
.customer-shell h1,
.document-shell h1,
.settings-shell h1,
.legal-card h1,
.section-heading h1 {
    font-size: clamp(32px, 5vw, 48px);
}

.kiosk-heading,
.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.status-pill,
.record-count {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.status-ready {
    color: var(--ready);
    background: var(--ready-bg);
}

.status-attention {
    color: var(--attention);
    background: var(--attention-bg);
}

.status-offline {
    color: var(--offline);
    background: var(--offline-bg);
}

.record-count {
    color: var(--brand);
    background: #e8f0fc;
}

.status-panel {
    display: grid;
    gap: 8px;
}

.status-panel span,
td span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.primary-button,
.secondary-button,
.text-button {
    min-height: 48px;
    border: 0;
    border-radius: 10px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.primary-button {
    width: 100%;
    margin-top: 24px;
    padding: 12px 18px;
    color: #fff;
    background: var(--button);
}

.secondary-button {
    width: 100%;
    margin-top: 24px;
    padding: 12px 18px;
    border: 1px solid var(--button);
    color: var(--button-dark);
    background: #fff;
}

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

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
}

.button-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.primary-button:hover {
    background: var(--button-dark);
}

.primary-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.text-button {
    padding: 8px 14px;
    color: var(--button-dark);
    background: transparent;
}

.compact-button {
    min-height: 38px;
    white-space: nowrap;
}

.language-switcher {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
}

.language-switcher button {
    min-height: 32px;
    padding: 5px 9px;
    border: 0;
    border-radius: 999px;
    color: var(--muted);
    background: transparent;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.language-switcher button.is-active {
    color: #fff;
    background: var(--button);
}

.help-text,
.confirmation {
    color: var(--muted);
    line-height: 1.5;
}

.confirmation {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

label {
    display: block;
    margin: 24px 0 8px;
    font-weight: 700;
}

input {
    width: 100%;
    min-height: 50px;
    padding: 10px 12px;
    border: 1px solid #aeb8c5;
    border-radius: 9px;
    color: var(--ink);
    background: #fff;
    font: inherit;
}

select {
    width: 100%;
    min-height: 50px;
    padding: 10px 12px;
    border: 1px solid #aeb8c5;
    border-radius: 9px;
    color: var(--ink);
    background: #fff;
    font: inherit;
}

input:focus,
select:focus {
    border-color: var(--brand);
    outline: 3px solid rgba(11, 62, 134, 0.16);
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-weight: 500;
    line-height: 1.5;
}

.checkbox-label input {
    flex: 0 0 auto;
    width: 20px;
    min-height: 20px;
    margin-top: 2px;
    accent-color: var(--button);
}

.label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
}

.label-row label {
    margin: 0 0 8px;
}

.label-row a {
    font-size: 14px;
}

.field-error {
    margin: 8px 0 0;
    color: var(--offline);
    font-weight: 600;
}

.field-hint,
.form-footer,
.context-line {
    color: var(--muted);
    line-height: 1.5;
}

.field-hint {
    margin: 7px 0 0;
    font-size: 13px;
}

.form-footer {
    margin: 26px 0 0;
    padding-top: 22px;
    border-top: 1px solid var(--line);
    text-align: center;
}

.context-line {
    padding: 12px 14px;
    border-radius: 10px;
    background: #f3f6fb;
}

.alert {
    margin: 18px 0;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    line-height: 1.5;
}

.alert-success {
    color: var(--ready);
    border-color: #b9dfc3;
    background: var(--ready-bg);
}

.alert-error {
    color: var(--offline);
    border-color: #edb9bc;
    background: var(--offline-bg);
}

.alert-error ul {
    margin-bottom: 0;
    padding-left: 20px;
}

.account-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 28px;
}

.account-panel {
    display: grid;
    gap: 8px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 16px;
}

.account-panel strong {
    font-size: 22px;
}

.account-panel span {
    overflow-wrap: anywhere;
    color: var(--muted);
}

.muted-panel {
    background: #f7f9fc;
}

.panel-label {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.verified-mark {
    color: var(--ready) !important;
    font-size: 13px;
    font-weight: 700;
}

.legal-card {
    line-height: 1.7;
}

.legal-card h2 {
    margin: 30px 0 8px;
    font-size: 21px;
}

.legal-card p {
    color: var(--muted);
}

.upload-card {
    margin-top: 30px;
    padding: clamp(20px, 5vw, 32px);
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fbfcfe;
}

.upload-brand {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.upload-brand h2,
.document-list-heading h2 {
    margin: 0 0 6px;
    font-size: clamp(24px, 4vw, 32px);
}

.upload-brand p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.private-badge {
    flex: 0 0 auto;
    padding: 7px 10px;
    border-radius: 999px;
    color: var(--ready);
    background: var(--ready-bg);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.file-picker {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0 0;
    padding: 22px;
    border: 2px dashed #f1b084;
    border-radius: 14px;
    background: var(--button-soft);
    cursor: pointer;
}

.file-picker:hover {
    border-color: var(--button);
}

.file-picker input {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.file-picker-icon {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--button);
    font-size: 25px;
    font-weight: 700;
}

.file-picker span:last-of-type {
    display: grid;
    gap: 4px;
    overflow: hidden;
}

.file-picker strong {
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-picker small,
.privacy-note {
    color: var(--muted);
    font-weight: 500;
    line-height: 1.45;
}

.privacy-note {
    margin: 14px 0 0;
    font-size: 13px;
}

.document-list-heading {
    align-items: center;
    margin-top: 42px;
}

.document-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 18px;
    align-items: start;
    margin-top: 14px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
}

.document-icon {
    display: grid;
    width: 52px;
    height: 62px;
    place-items: center;
    border-radius: 8px;
    color: var(--button-dark);
    background: var(--button-soft);
    font-size: 11px;
    font-weight: 900;
}

.document-details {
    min-width: 0;
}

.document-details h3 {
    margin: 2px 0 7px;
    overflow: hidden;
    font-size: 17px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-details > p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.setting-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.setting-summary span,
.file-facts span {
    padding: 5px 8px;
    border-radius: 7px;
    color: #46536a;
    background: #eef2f7;
    font-size: 11px;
    font-weight: 750;
}

.document-actions {
    display: grid;
    gap: 8px;
    min-width: 130px;
}

.document-actions .secondary-button {
    min-height: 40px;
    margin: 0;
    padding: 8px 12px;
    font-size: 13px;
}

.danger-text-button {
    width: 100%;
    min-height: 36px;
    padding: 6px 10px;
    border: 0;
    border-radius: 8px;
    color: var(--button-dark);
    background: transparent;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.danger-text-button:hover {
    background: var(--button-soft);
}

.empty-state {
    display: grid;
    gap: 6px;
    margin-top: 14px;
    padding: 32px 20px;
    border: 1px dashed #bdc7d4;
    border-radius: 16px;
    color: var(--muted);
    text-align: center;
}

.empty-state strong {
    color: var(--ink);
}

.checkout-notice {
    background: #fffaf6;
}

.file-name {
    overflow-wrap: anywhere;
}

.file-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 24px 0 8px;
}

.settings-group {
    min-width: 0;
    margin: 30px 0 0;
    padding: 0;
    border: 0;
}

.settings-group legend {
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 800;
}

.option-grid {
    display: grid;
    gap: 10px;
}

.two-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.option-card {
    position: relative;
    margin: 0;
    cursor: pointer;
}

.option-card input {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 1px;
    opacity: 0;
}

.option-card span {
    display: grid;
    min-height: 58px;
    gap: 3px;
    place-content: center;
    padding: 10px;
    border: 1px solid #aeb8c5;
    border-radius: 10px;
    text-align: center;
}

.option-card small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
}

.option-card input:checked + span {
    border-color: var(--button);
    color: var(--button-dark);
    background: var(--button-soft);
    box-shadow: inset 0 0 0 1px var(--button);
}

.option-card input:focus-visible + span {
    outline: 3px solid rgba(237, 125, 49, 0.2);
}

.settings-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 30px;
}

.settings-row label {
    margin-top: 0;
}

.table-wrap {
    margin-top: 24px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

tbody tr:last-child td {
    border-bottom: 0;
}

@media (max-width: 640px) {
    .site-header,
    .site-footer,
    .page-shell {
        width: min(100% - 20px, 1120px);
    }

    .site-header {
        min-height: 64px;
    }

    .brand > span:last-child {
        display: none;
    }

    .page-shell {
        padding-block: 24px 48px;
    }

    .site-footer,
    .kiosk-heading,
    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .kiosk-card,
    .form-card,
    .customer-shell,
    .document-shell,
    .settings-shell,
    .legal-card {
        border-radius: 18px;
    }

    .header-tools {
        align-items: flex-end;
        flex-direction: column;
        gap: 4px;
    }

    .language-switcher button {
        padding-inline: 7px;
        font-size: 11px;
    }

    .button-row,
    .account-grid,
    .two-options,
    .three-options,
    .settings-row {
        grid-template-columns: 1fr;
    }

    .button-row .primary-button {
        margin-bottom: 0;
    }

    .upload-brand,
    .document-card {
        grid-template-columns: 1fr;
    }

    .upload-brand {
        flex-direction: column;
    }

    .document-icon {
        width: 44px;
        height: 50px;
    }

    .document-actions {
        grid-template-columns: 1fr 1fr;
    }
}
