/* Shared visual language: ink, warm paper, sage and restrained brass. */
:root {
    --trust-bg: #f5f2eb;
    --trust-bg-accent: radial-gradient(ellipse at 0 0, #e7e9e0 0, transparent 48%), linear-gradient(160deg, #f8f6f0, #f0ede5);
    --trust-surface: #fffefb;
    --trust-surface-strong: #fffefb;
    --trust-border: #ded8cb;
    --trust-shadow: 0 18px 48px rgba(23, 43, 58, .07);
    --trust-shadow-soft: 0 5px 18px rgba(23, 43, 58, .04);
    --trust-text: #172b3a;
    --trust-muted: #5d6869;
    --trust-primary: #172b3a;
    --trust-primary-strong: #263f4d;
    --trust-success: #3f6454;
    --trust-danger: #974b42;
    --trust-chip-bg: #efeee5;
    --trust-chip-border: #ded8cb;
    --noble-brass: #a48755;
    --noble-brass-ink: #7a6034;
    --noble-paper: #f5f2eb;
    --noble-sage: #71877c;
    --noble-soft: #f3f3ec;
}

html { background: var(--noble-paper); color-scheme: light; }
body { font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Arial, sans-serif; }
body.trust-page, body.capture-page, body.ios-capture-page, body.application-page {
    color: var(--trust-text); font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    background: var(--trust-bg-accent); min-height: 100vh; margin: 0;
}
button, input, select, textarea { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--noble-brass); outline-offset: 4px; }
button:disabled { opacity: .65; cursor: wait; }

.site-masthead { max-width: 1120px; margin: 0 auto; padding: 24px 28px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.site-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--trust-text); text-decoration: none; }
.site-brand img { width: 42px; height: 42px; border-radius: 12px; }
.site-brand strong { display: block; font-size: 19px; font-weight: 650; letter-spacing: -.025em; line-height: 1.25; }
.site-brand small { display: block; margin-top: 3px; font-size: 10px; font-weight: 600; letter-spacing: .14em; color: var(--trust-muted); }
.masthead-note { color: var(--trust-muted); font-size: 12px; letter-spacing: .04em; display: flex; align-items: center; gap: 8px; }
.masthead-note::before { content: ''; width: 6px; height: 6px; background: var(--noble-sage); border-radius: 50%; }
.page-shell { min-height: calc(100vh - 96px); padding-top: 16px; padding-bottom: 52px; }
.page-card { border-radius: 22px; border-top: 3px solid var(--noble-brass); backdrop-filter: none; }
.trust-title, .ios-capture-page .title, .capture-page .title { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; letter-spacing: -.035em; line-height: 1.13; }
.trust-title { max-width: 710px; font-size: clamp(2.1rem, 4.5vw, 3.7rem); margin-top: 22px; }
.trust-kicker, .ios-topline, .capture-topline { background: var(--noble-soft); border-color: var(--trust-border); color: var(--noble-brass-ink); border-radius: 6px; font-weight: 600; letter-spacing: .07em; font-size: .76rem; text-transform: uppercase; padding: 8px 11px; }
.trust-lead { font-size: 1rem; line-height: 1.8; }
.trust-badge, .ios-badge, .capture-chip { border-radius: 7px; box-shadow: none; background: var(--noble-soft); border: 1px solid var(--trust-border); color: var(--trust-muted); padding: 8px 11px; font-size: .8rem; font-weight: 500; }
.trust-badges { gap: 8px; }
.primary-btn, .ios-primary-btn, .file-trigger, .popup-close, .capture-page .btn-start {
    color: #fffefb; background: var(--trust-primary); border: 1px solid var(--trust-primary);
    border-radius: 9px; box-shadow: 0 5px 14px rgba(23, 43, 58, .12); font-weight: 600; min-height: 52px;
}
.primary-btn:hover, .ios-primary-btn:hover, .file-trigger:hover, .popup-close:hover { color: #fffefb; background: var(--trust-primary-strong); border-color: var(--trust-primary-strong); }
.secondary-btn { background: var(--trust-success); box-shadow: none; border-radius: 9px; }
.ghost-btn, .guide-toggle-btn { border-radius: 9px; background: #fffefb; border-color: var(--trust-border); box-shadow: none; color: var(--trust-text); }
.danger-btn { background: var(--trust-danger); box-shadow: none; border-radius: 9px; }
.page-note { font-size: .85rem; line-height: 1.7; }
.status-item { border-radius: 12px; background: var(--noble-soft); box-shadow: none; border-color: var(--trust-border); }
.status-item strong { color: var(--trust-text); font-size: .94rem; font-weight: 600; }
.status-item span { font-size: .88rem; }

/* The same capture flow is used on phones and desktop. */
.ios-capture-page .section { padding-top: 8px; }
.ios-shell { max-width: 1040px; }
.ios-card { display: grid; grid-template-columns: minmax(0, 1fr) 214px; gap: 22px 28px; background: var(--trust-surface); border-color: var(--trust-border); border-radius: 22px; padding: 32px; box-shadow: var(--trust-shadow); border-top: 3px solid var(--noble-brass); }
.ios-card > * { order: 2; }
.ios-card > .ios-header { order: 0; }
.ios-card > .capture-example { order: 1; }
.ios-header { grid-column: 1; grid-row: 1; gap: 15px; margin: 0; }
.ios-capture-page .title { font-size: clamp(1.9rem, 3.2vw, 2.8rem); color: var(--trust-text); }
.ios-description { color: var(--trust-muted); font-size: .94rem; line-height: 1.75; }
.ios-badges { gap: 7px; }
.ios-instructions li, .guide-checklist li { border-radius: 10px; background: var(--noble-soft); border-color: #e6e2d7; color: var(--trust-text); font-size: .9rem; padding: 11px 12px; }
.instruction-dot { background: #e4e8df; color: #3e5b4f; font-size: .75rem; width: 23px; min-width: 23px; height: 23px; }
.capture-example { grid-column: 2; grid-row: 1; margin: 0; align-self: start; background: var(--noble-paper); border: 1px solid var(--trust-border); border-radius: 14px; padding: 10px; }
.capture-example button { display: block; width: 100%; padding: 0; background: none; border: 0; cursor: pointer; }
.capture-example img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: contain; }
.capture-example figcaption { text-align: center; font-size: .72rem; color: var(--trust-muted); padding: 7px 2px 2px; }
.document-type-picker, .ios-uploader, #preview, .ios-card > .page-note, #upload_all_btn { grid-column: 1 / -1; }
.document-type-picker { margin: 0; padding: 18px; background: var(--noble-soft); border-color: var(--trust-border); border-radius: 14px; }
.document-type-card { border-radius: 9px; border-color: var(--trust-border); box-shadow: none; background: var(--trust-surface); padding: 14px; }
.document-type-card strong { color: var(--trust-text); font-size: .9rem; font-weight: 650; }
.document-type-card span { color: var(--trust-muted); font-size: .81rem; }
.document-type-option input:checked + .document-type-card { border-color: var(--noble-brass); box-shadow: inset 0 0 0 1px var(--noble-brass); background: #faf7ef; transform: none; }
.document-type-option input:focus-visible + .document-type-card { outline: 3px solid var(--noble-brass); outline-offset: 3px; }
.document-type-error { color: var(--trust-danger); }
.ios-uploader { margin: 0; border-radius: 14px; padding: 20px; background: var(--noble-soft); border: 1px dashed #b9b7a7; }
.file-label, .file-helper { color: var(--trust-text); }
.file-helper { color: var(--trust-muted); font-size: .86rem; }
.file-trigger { width: fit-content; min-width: 175px; }
#preview { margin-top: 0 !important; }
#preview:empty { display: none; }
.preview-card { border-color: var(--trust-border); background: var(--noble-soft); box-shadow: none; border-radius: 14px; }
.preview-image { object-fit: contain; background: #e9e6dd; border-radius: 9px; height: min(430px, 56vh); }
.preview-actions { grid-template-columns: 1fr 1fr; }
.preview-retake { background: var(--trust-primary); box-shadow: none; border-radius: 9px; }
.preview-delete { color: var(--trust-danger); border-color: #d8c8bc; background: #fffefb; box-shadow: none; border-radius: 9px; }
#upload_all_btn { order: 5; margin: 0; justify-self: start; min-width: 190px; }
.ios-card > .page-note { order: 6; margin: 0; }

/* A portrait example remains portrait, including on small screens. */
#popup-overlay { z-index: 100; padding: 24px 14px; background: rgba(17, 31, 40, .7); backdrop-filter: blur(5px); }
#popup { position: relative; top: auto; left: auto; transform: none; margin: 0 auto; width: min(100%, 520px); max-height: none; overflow: visible; padding: 24px; border-radius: 18px; background: var(--trust-surface); border: 1px solid var(--trust-border); gap: 13px; }
.popup-title { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; color: var(--trust-text); font-size: 1.9rem; }
.popup-description { color: var(--trust-muted); font-size: .9rem; }
.popup-image { display: block; width: auto; max-width: 100%; height: min(45vh, 430px); max-height: none; aspect-ratio: 2 / 3; object-fit: contain; margin: 0 auto; background: var(--noble-paper); border-radius: 12px; }
.popup-close { position: sticky; bottom: 12px; z-index: 2; }
.guide-checklist li { font-size: .82rem; }

/* Public application: same colours, fields and spacing as capture. */
.application-page .sub-page-content { padding: 10px 24px 60px; }
.application-page .sub-page-content > .container { width: 100%; max-width: 1040px; margin: 0 auto; }
.application-page .omForm { display: block; width: 100%; color: var(--trust-text); font-size: 15px; }
.application-page #omFormContent { width: 100%; }
.application-page .omForm h1 { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(2.2rem, 5vw, 3.5rem); font-weight: 400; line-height: 1.12; letter-spacing: -.035em; margin: 0 0 12px; color: var(--trust-text); }
.application-intro { margin: 0 0 28px; max-width: 680px; color: var(--trust-muted); font-size: .96rem; line-height: 1.75; }
.application-page .form-page { padding: 25px !important; margin: 0 0 18px; border: 1px solid var(--trust-border); border-radius: 16px; background: var(--trust-surface); box-shadow: var(--trust-shadow-soft); }
.application-page .form-page-header { padding-bottom: 18px; margin-bottom: 20px; border-bottom: 1px solid #e9e4d9; font-size: 1.05rem; color: var(--trust-text); }
.application-page .form-page-header strong { font-weight: 650; }
.application-page .form-page-items-col3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 0 0 20px; }
.application-page .form-page-items-col3:last-child { margin-bottom: 0; }
.application-page .form-page-item { min-width: 0; width: auto; float: none; }
.application-page .form-page-item.wide-col { grid-column: 1 / -1; }
.application-page .omLabel { display: block; font-size: .82rem; font-weight: 600; line-height: 1.5; margin: 0 0 8px; color: #35454c; }
.application-page .form-input { position: relative; }
.application-page .omInputText, .application-page .birth_part { display: block; width: 100%; min-width: 0; min-height: 48px; padding: 11px 12px; font-size: .92rem; border: 1px solid #cfcbbf; border-radius: 8px; background-color: #fffefb; color: var(--trust-text); box-shadow: none; }
.application-page select.omInputText, .application-page select.birth_part { padding-right: 22px; appearance: auto; }
.application-page .omInputText:hover, .application-page .birth_part:hover { border-color: #929c91; }
.application-page .omInputText:focus, .application-page .birth_part:focus { border-color: var(--noble-brass); outline: 2px solid #e7dcc4; outline-offset: 1px; }
.application-page .omInputText::placeholder { color: #7a827b; }
.application-page .three-input { display: grid; grid-template-columns: .8fr 1fr 1fr; gap: 8px; }
.application-page .omHelp-block { display: none; font-size: .78rem; color: var(--trust-danger); line-height: 1.5; margin-top: 6px; }
.application-page .invalid .error-message { display: block; }
.application-page .invalid .omInputText, .application-page .invalid .birth_part { border-color: var(--trust-danger); }
.application-page .valid .omInputText, .application-page .valid .birth_part { border-color: var(--noble-sage); }
.application-page .omForm-dropdown { display: none; }
.application-page .omTooltip-icon { cursor: help; display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; border: 1px solid #aab0a5; border-radius: 50%; color: var(--trust-muted); font-size: 11px; margin-left: 4px; }
.application-page .omTooltip-text { display: none; }
.application-page .omTooltip:hover .omTooltip-text { display: block; padding: 8px; color: var(--trust-muted); font-size: .78rem; }
.application-page .omFlagInputBox, .application-page .omDataOD { font-size: .79rem; color: var(--trust-muted); line-height: 1.8; font-weight: 400; }
.application-page .omFlagInputBox { margin-bottom: 15px; }
.application-page .omForm a { color: var(--trust-primary); text-decoration: underline; text-underline-offset: 3px; }
.application-page .form-submit { padding-top: 24px; }
.application-page .form-submit .primary-btn { width: auto; min-width: 240px; color: #fffefb; text-decoration: none; }
.application-page .form-progress-note { margin: 14px 0 25px; color: var(--noble-brass-ink); text-transform: uppercase; font-size: .7rem; letter-spacing: .13em; font-weight: 600; }
.preview-shortcut { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 0 0 24px; }
.preview-shortcut .ghost-btn { min-height: 42px; padding: 10px 15px; font-size: .84rem; }
.preview-shortcut span { font-size: .8rem; color: var(--trust-muted); }

@media (max-width: 760px) {
    .site-masthead { padding: 20px; }
    .site-brand img { width: 36px; height: 36px; }
    .site-brand strong { font-size: 17px; }
    .masthead-note { display: none; }
    .page-shell { min-height: calc(100vh - 80px); padding: 10px 16px 32px; align-items: flex-start; }
    .page-card { padding: 26px 22px; border-radius: 17px; }
    .trust-title { font-size: 2.4rem; }
    .ios-capture-page .section { padding: 4px 16px 32px; }
    .ios-card { grid-template-columns: 1fr; padding: 22px 18px; gap: 20px; border-radius: 17px; }
    .ios-header { grid-column: 1; grid-row: auto; }
    .capture-example { grid-column: 1; grid-row: auto; width: 100%; display: flex; flex-direction: column; align-items: center; padding: 10px; }
    .capture-example button { width: auto; }
    .capture-example img { width: auto; height: 228px; max-width: 100%; }
    .capture-example figcaption { padding-top: 5px; }
    .document-type-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
    .document-type-picker { padding: 14px; }
    .file-trigger, .ios-primary-btn, #upload_all_btn { width: 100%; }
    #popup-overlay { padding: 12px; }
    #popup { padding: 18px; border-radius: 15px; }
    .popup-image { height: min(42vh, 340px); }
    .application-page .sub-page-content { padding: 8px 16px 40px; }
    .application-page .form-page { padding: 20px 16px !important; border-radius: 13px; }
    .application-page .form-page-items-col3 { grid-template-columns: 1fr; gap: 19px; }
    .application-page .form-page-item { width: 100%; }
    .application-page .form-submit .primary-btn { width: 100%; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* One decision per screen: choose a document once, then photograph it. */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.document-choice-shell { padding: 28px 24px 60px; }
.document-choice-panel { max-width: 640px; margin: 0 auto; background: var(--trust-surface); border: 1px solid var(--trust-border); border-top: 2px solid var(--noble-brass); border-radius: 18px; padding: 32px; box-shadow: var(--trust-shadow-soft); }
.document-choice-panel h1 { font: 400 clamp(1.8rem, 4vw, 2.35rem)/1.15 Georgia, 'Times New Roman', serif; letter-spacing: -.025em; color: var(--trust-text); margin: 0 0 12px; }
.document-choice-panel > p { margin: 0 0 26px; color: var(--trust-muted); font-size: .94rem; line-height: 1.6; }
.document-choice-options { border: 0; padding: 0; margin: 0 0 26px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-width: 0; }
.document-choice-option { display: flex; align-items: center; gap: 12px; min-height: 70px; padding: 16px; border: 1px solid var(--trust-border); border-radius: 10px; cursor: pointer; background: #fffefb; font-size: .94rem; font-weight: 500; }
.document-choice-option input { width: 18px; height: 18px; margin: 0; flex-shrink: 0; accent-color: var(--trust-primary); }
.document-choice-option:has(input:checked) { border-color: var(--noble-brass); background: #f8f5ed; box-shadow: inset 0 0 0 1px var(--noble-brass); }
.document-choice-error { color: var(--trust-danger); margin: 0 0 18px; font-size: .9rem; }
.document-choice-panel .primary-btn { min-width: 160px; }
.capture-flow { padding: 10px 24px 48px; }
.capture-panel { display: grid; grid-template-columns: 230px minmax(0, 1fr); align-items: center; gap: 24px 32px; max-width: 780px; padding: 30px; margin: 0 auto; border: 1px solid var(--trust-border); border-top: 2px solid var(--noble-brass); border-radius: 18px; background: var(--trust-surface); box-shadow: var(--trust-shadow-soft); }
.capture-heading { grid-column: 1 / -1; }
.capture-progress { margin: 0 0 12px; color: var(--noble-brass-ink); font-size: .75rem; font-weight: 600; letter-spacing: .06em; }
.capture-heading h1 { font: 400 clamp(1.65rem, 3.3vw, 2.15rem)/1.2 Georgia, 'Times New Roman', serif; letter-spacing: -.025em; color: var(--trust-text); margin: 0 0 12px; }
.capture-summary { color: var(--trust-muted); line-height: 1.65; font-size: .93rem; margin: 0; }
.capture-visual { margin: 0; justify-self: center; }
.capture-visual img { display: block; width: 210px; height: 315px; max-width: 100%; object-fit: contain; }
.capture-controls { display: grid; gap: 16px; min-width: 0; }
.capture-controls .ios-uploader { padding: 0; margin: 0; border: 0; background: transparent; }
.capture-controls .file-trigger { width: 100%; min-width: 0; }
.capture-controls #upload_all_btn { order: 0; width: 100%; min-width: 0; margin: 0; }
.capture-controls .requirements-link { border: 0; background: none; padding: 4px; width: fit-content; color: var(--trust-muted); font-size: .84rem; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; justify-self: center; }
.capture-controls .preview-image { height: 230px; }
.capture-controls .preview-card { padding: 10px; }
.capture-controls #preview { gap: 0; display: block; }
.capture-controls #preview:empty { display: none; }
.capture-controls .preview-actions { grid-template-columns: 1fr 1fr; gap: 8px; }
.capture-controls .preview-retake, .capture-controls .preview-delete { min-height: 42px; font-size: .8rem; }
@media (max-width: 600px) {
    .document-choice-shell { padding: 8px 16px 36px; }
    .document-choice-panel { padding: 24px 20px; border-radius: 14px; }
    .document-choice-options { grid-template-columns: 1fr; gap: 10px; }
    .document-choice-option { min-height: 58px; }
    .document-choice-panel .primary-btn { width: 100%; }
    .capture-flow { padding: 4px 16px 32px; }
    .capture-panel { grid-template-columns: 1fr; padding: 23px 18px; gap: 20px; border-radius: 14px; }
    .capture-visual img { width: 160px; height: 240px; }
    .capture-controls { width: 100%; gap: 14px; }
}
