/* Shared upload layout: sample fields on the left, report and actions on the right. */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/outfit/outfit-latin.woff2') format('woff2');
}
:root {
  color-scheme: light;
  --bg: #f5f7f7;
  --bg3: #fff;
  --surface-inset: #fff;
  --surface-muted: #efefef;
  --surface-hover: #f4f8f8;
  --text: #2d2d2d;
  --text-muted: #666;
  --placeholder: #adadad;
  --border: #efefef;
  --card-border: #e5e9e9;
  --control-border: #efefef;
  --field-border: #dce3e5;
  --accent: #4a9db5;
  --accent-hover: #3d8ca3;
  --accent-text: var(--accent);
  --accent-text-strong: var(--accent-hover);
  --danger: #bf4655;
  --success: #34764e;
  --brand-button: var(--accent);
  --button-accent: var(--accent);
  --button-text: #fff;
}
html[data-checkout-theme="dark"] {
  color-scheme: dark;
  --bg: #13181c;
  --bg3: #191e23;
  --surface-inset: #13181c;
  --surface-muted: #11171b;
  --surface-hover: #23323a;
  --text: #e9e9e9;
  --text-muted: #bec3c7;
  --placeholder: #a6adb3;
  --border: #2c363e;
  --card-border: #0e1416;
  --control-border: #35434c;
  --field-border: #35434c;
  --accent-text: #83c6d7;
  --accent-text-strong: #83c6d7;
  --danger: #ed8791;
  --success: #7ac8a8;
}
*, *::before, *::after { box-sizing: border-box; font-family: inherit; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Montserrat', sans-serif; font-size: 16px; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: var(--accent-text); }
button, a, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.page { display: flex; justify-content: center; align-items: center; min-height: 100vh; width: 100%; margin: 0; padding: 20px; }
.card { display: flex; flex-direction: column; position: relative; width: 100%; max-width: 900px; min-height: 540px; padding: 30px; background: var(--bg3); border: 1px solid var(--card-border); border-radius: 22px; box-shadow: 0 2px 8px #1d303005; }
.hero { position: relative; display: flex; flex-shrink: 0; align-items: center; justify-content: flex-start; min-height: 40px; margin-bottom: 25px; padding-left: 38px; }
.hero h1 { margin: 0; color: var(--text); text-align: center; font-size: 16px; font-weight: 700; line-height: normal; letter-spacing: normal; }
.btn-back { position: absolute; left: 0; top: 50%; transform: translateY(-50%); display: flex; align-items: center; padding: 0; border: 0; background: none; color: var(--text); }
.btn-back svg { width: 24px; height: 24px; }
.btn-back:hover { color: var(--accent); }
.upload-count { position: absolute; right: 0; color: var(--text-muted); font-size: 12px; font-weight: 500; }
.checkout-header-actions { position: absolute; right: 0; display: flex; align-items: center; gap: 16px; }
.checkout-header-actions .upload-count { position: static; white-space: nowrap; }
.checkout-theme-toggle { position: relative; flex-shrink: 0; width: 46px; height: 26px; margin-left: auto; padding: 0; border: 0; border-radius: 999px; background: #d4dadd; transition: background .18s; }
.checkout-theme-toggle::before { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .18s; }
.checkout-theme-toggle[aria-pressed="true"] { background: var(--accent); }
.checkout-theme-toggle[aria-pressed="true"]::before { transform: translateX(20px); }
.lead-sub { display: none; }
.content { display: flex; flex: 1 0 auto; align-items: stretch; gap: 40px; }
.form-card { display: flex; flex-direction: column; flex-shrink: 0; width: 320px; padding-right: 28px; border-right: 1px solid var(--border); }
.upload-box { display: flex; flex-direction: column; flex-grow: 1; padding: 0; background: transparent; border: 0; border-radius: 0; }
#raw-file-field { display: flex; flex-direction: column; flex-grow: 1; }
#prepay-form { margin-bottom: auto; }
.upload-action { padding-top: 24px; }
.dropzone { display: block; margin: 12px 0 0; padding: 0; border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.dz-btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 40px; border: 0; border-radius: 8px; padding: 9px 16px; background: var(--brand-button); color: var(--button-text); font-size: 14px; font-weight: 600; pointer-events: none; transition: filter .2s; }
.dz-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.dropzone:hover .dz-btn, .dropzone.drag-over .dz-btn { background: var(--accent-hover); }
.dropzone.drag-over { outline: 2px solid var(--button-accent); outline-offset: 4px; }
.upload-formats, .drop-hint { margin: 0 0 5px; color: var(--text-muted); font-size: 11px; font-weight: 500; line-height: 1.5; }
.upload-guide { margin-top: 18px; padding: 0; border: 0; background: none; color: var(--accent-text); text-align: left; font-size: 12px; font-weight: 600; line-height: 1.5; text-decoration: underline; text-underline-offset: 3px; }
.summary-card { display: flex; flex-direction: column; flex-grow: 1; min-width: 0; }
.tabs-container { display: flex; flex-direction: column; align-items: center; width: 100%; }
.pkg-pills { display: flex; width: 100%; max-width: 450px; margin: 0 auto 25px; padding: 4px; background: var(--surface-muted); border-radius: 10px; }
.pkg { flex: 1; min-width: 0; padding: 10px; border: 0; border-radius: 8px; background: none; color: var(--text-muted); text-align: center; font-size: 13px; font-weight: 600; letter-spacing: .3px; transition: color .2s, background .2s; }
.pkg.on { background: var(--brand-button); color: var(--button-text); }
.checkout-details { flex-grow: 1; min-width: 0; margin-bottom: 20px; }
.sample-intro { margin: 0 0 25px; color: var(--text-muted); font-size: 13px; font-weight: 500; line-height: 1.5; }
.sample-intro.preview-description { margin: 0 0 25px; color: var(--text); font-family: 'Montserrat', sans-serif; font-size: 16px; font-weight: 700; line-height: normal; letter-spacing: normal; }
.traits-intro { margin-bottom: 28px; }
.traits-intro h2 { margin: 0 0 8px; color: var(--text); font-family: 'Montserrat', sans-serif; font-size: 16px; font-weight: 700; line-height: normal; letter-spacing: normal; }
.traits-intro p { margin: 0; color: var(--text); font-size: 13px; font-weight: 500; line-height: 1.5; }
.file-info { display: flex; align-items: center; gap: 12px; min-width: 0; margin-bottom: 18px; }
.file-info svg { flex-shrink: 0; width: 20px; height: 20px; color: var(--text); }
#file-name { min-width: 0; overflow-wrap: anywhere; color: var(--accent-text); font-size: 13px; font-weight: 500; }
.sample-fields { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 18px; }
.ancestry-file-form #prepay-form, .ancestry-file-form .sample-row { display: flex; flex-direction: column; flex: 1; margin-bottom: 0; }
.ancestry-file-form .sample-fields { flex: 1; grid-template-rows: auto 1fr; gap: 18px; padding-bottom: 18px; }
.ancestry-file-form #mixed-field { align-self: center; }
.ancestry-file-form > .upload-guide { margin-top: 0; }
.raw-coordinate-note { margin: 0 0 8px; color: var(--text); font-size: 12px; font-weight: 600; line-height: 1.4; }
@media (min-width: 901px) {
  html:not(.post-payment-upload) .ancestry-report-card, .free-preview-card, .trait-report-card { min-height: 500px; }
  .ancestry-file-form .sample-fields { display: flex; flex-direction: column; align-items: stretch; justify-content: center; padding-top: 18px; }
  .ancestry-report-card .sample-fields, .free-preview-card .sample-fields { justify-content: flex-start; }
  .ancestry-file-form .sample-fields > .field { flex-shrink: 0; }
  .ancestry-file-form #mixed-field { align-self: stretch; }
}
.field { min-width: 0; margin: 0; }
.field > label { display: block; margin-bottom: 8px; color: var(--text); font-size: 12px; font-weight: 600; line-height: 1.4; }
.field input { width: 100%; min-width: 0; height: 36px; padding: 8px 12px; border: 2px solid var(--control-border); border-radius: 8px; background: var(--surface-inset); color: var(--text); font-size: 13px; font-weight: 500; }
.field input::placeholder { color: var(--placeholder); }
.field input:focus { border-color: var(--accent); outline: none; }
.mix-toggle { display: inline-flex; min-height: 36px; padding: 3px; background: var(--surface-muted); border-radius: 8px; }
.mix-opt { min-width: 45px; padding: 5px 10px; border: 0; border-radius: 5px; background: transparent; color: var(--text-muted); font-size: 12px; font-weight: 600; }
.mix-opt.active { background: var(--brand-button); color: var(--button-text); }
.mix-dropdown { position: relative; width: 100%; min-width: 0; }
.mix-trigger { display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 36px; padding: 7px 9px; border: 2px solid var(--control-border); border-radius: 8px; background: var(--surface-inset); color: var(--text); font-size: 12px; font-weight: 600; cursor: pointer; }
.mix-trigger .chev { width: 10px; height: 6px; flex-shrink: 0; }
.mix-dropdown.open .chev { transform: rotate(180deg); }
.mix-panel { display: none; position: absolute; top: calc(100% + 5px); right: 0; width: max(100%, 220px); z-index: 50; padding: 5px; background: var(--bg3); border: 2px solid var(--border); border-radius: 9px; box-shadow: 0 5px 18px #17242e16; }
.mix-dropdown.open .mix-panel { display: block; }
.mix-panel .mix-search { display: block; width: 100%; height: 36px; margin: 0 0 5px; padding: 8px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: var(--bg3); color: var(--text); font-size: 13px; font-weight: 500; }
.mix-panel .mix-search::placeholder { color: var(--text-muted); }
.mix-panel .mix-search:focus { border-bottom-color: var(--accent); outline: none; }
.mix-list { max-height: 240px; overflow-y: auto; }
.mix-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 8px; cursor: pointer; font-size: 12px; font-weight: 600; line-height: 1.4; border-radius: 5px; }
.mix-item:hover { background: var(--surface-hover); }
.mix-item .check { width: 16px; height: 16px; flex-shrink: 0; color: var(--accent); opacity: 0; }
.mix-item.sel .check { opacity: 1; }
.mix-item.sel { font-weight: 700; }
.mix-empty { margin: 0; padding: 12px 8px; color: var(--text-muted); font-size: 12px; font-weight: 500; line-height: 1.4; }
.mix-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mix-chips:empty { display: none; }
.mix-chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 7px; color: var(--accent-text-strong); background: transparent; font-size: 10px; font-weight: 600; }
.mix-chip .x { cursor: pointer; font-size: 14px; }
#privacy-label { display: flex; align-items: center; gap: 10px; margin: 20px 0 17px; color: var(--text); font-size: 13px; font-weight: 500; line-height: 1.5; cursor: pointer; }
#privacy-label a { color: var(--accent-text); font-weight: 600; text-decoration: none; }
#privacy-label a:hover { text-decoration: underline; }
#privacy-check { appearance: none; flex-shrink: 0; width: 20px; height: 20px; margin: 0; border: 2px solid var(--control-border); border-radius: 6px; background: var(--surface-inset); cursor: pointer; }
#privacy-check:checked { border-color: var(--accent); background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m5 12 4 4L19 6' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }
.checkout-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 15px; margin-top: auto; padding-top: 12px; border-top: 2px solid var(--border); }
.summary-total { color: var(--text); font-family: 'Outfit', sans-serif; font-size: 16px; font-weight: 800; white-space: nowrap; }
.summary-total strong { margin-left: 5px; color: var(--accent-text); font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cta-stack { display: flex; gap: 15px; }
.btn { display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--button-accent); border-radius: 10px; padding: 12px 20px; background: var(--bg3); color: var(--accent-text); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.btn-primary { padding: 12px 24px; border-color: transparent; border-radius: 8px; background: var(--brand-button); color: var(--button-text); }
#btn-pay, .checkout-action { height: 40px; padding-block: 0; }
.btn-primary:hover { background: var(--accent-hover); }
.btn:disabled { opacity: .55; cursor: default; }
.status-box { display: none; margin: 0 0 18px; color: var(--accent-text-strong); font-size: 13px; font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
.status-box.show { display: block; }
.status-box.error, .status-box.muted { color: var(--danger); }
.status-box.success { color: var(--success); }
.privacy-hint { margin: 0 0 12px; color: var(--danger); font-size: 12px; line-height: 1.5; }
.quick-account { display: none; }
.quick-account.show { display: block; }
.quick-account-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.quick-account-head .section-title { margin: 0; font-size: 16px; font-weight: 700; }
.quick-tabs { display: flex; border: 2px solid var(--border); border-radius: 7px; overflow: hidden; }
.quick-tab { padding: 6px 10px; border: 0; background: var(--bg3); color: var(--text-muted); font-size: 11px; font-weight: 600; }
.quick-tab.on { background: var(--brand-button); color: var(--button-text); }
.quick-account .field { margin-bottom: 14px; }
.quick-account-note { color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.content.account-step .form-card, .content.account-step .tabs-container, .content.account-step .sample-intro, .content.account-step #prepay-form, .content.account-step #privacy-label, .content.account-step .summary-total { display: none; }
.content.account-step .summary-card { max-width: 480px; margin: auto; }
.content.account-step .checkout-footer { justify-content: flex-end; }
.post-payment-upload .card { max-width: 610px; }
.post-payment-upload .upload-count { display: none; }
.post-payment-upload .lead-sub { display: block; margin: 0 0 25px; color: var(--text-muted); font-size: 13px; font-weight: 500; line-height: 1.5; }
.content.postpay .form-card { width: 100%; padding-right: 0; border-right: 0; }
.content.postpay #prepay-form { display: none; }
.content.postpay .drop-hint { display: none; }
#postpay-actions { flex-direction: column; margin-top: 25px; }
/* Download guides retain their existing layout and screenshots in both themes. */
html[data-checkout-theme="dark"] #dna-guide-modal > div,
html[data-checkout-theme="dark"] #dna-guide-modal > div > div:first-child { background: var(--bg3) !important; }
html[data-checkout-theme="dark"] #dna-guide-modal h2,
html[data-checkout-theme="dark"] #dna-guide-modal button span { color: var(--text) !important; }
html[data-checkout-theme="dark"] #dna-guide-modal button { color: var(--text-muted) !important; }
html[data-checkout-theme="dark"] #dna-guide-modal [style*="border-bottom"] { border-color: var(--border) !important; }
html[data-checkout-theme="dark"] #dna-guide-modal svg { stroke: var(--accent-text); }
html[data-checkout-theme="dark"] #quick-otp-field a { color: var(--accent-text) !important; }
html[data-checkout-theme="dark"] #privacy-hint { color: var(--danger); }
html[data-checkout-theme="dark"] #file-name2 { color: var(--accent-text); }
@media (max-width: 900px) {
  .card { min-height: 680px; }
  .hero { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px 14px; padding-left: 0; }
  .hero h1 { text-align: left; }
  .btn-back { align-self: flex-start; position: static; transform: none; }
  .upload-count { position: static; grid-column: 2; font-size: 12px; }
  .checkout-header-actions { position: static; grid-column: 2; justify-content: space-between; }
  .content { flex-direction: column; gap: 25px; }
  .form-card { width: 100%; padding: 0 0 25px; border-right: 0; border-bottom: 1px solid var(--border); }
  .content.postpay .form-card { padding-bottom: 0; border-bottom: 0; }
  .summary-card { display: contents; }
  .tabs-container { order: -1; }
  .pkg-pills { margin-bottom: 0; }
  .checkout-details { margin-bottom: 0; }
  #privacy-label { align-items: flex-start; margin: 0; }
  #privacy-label span { min-width: 0; }
  .checkout-footer { flex-direction: column; align-items: flex-start; gap: 20px; }
  #prepay-actions { width: 100%; }
  #prepay-actions button { flex: 1; }
  .content.account-step .summary-card { display: block; width: 100%; }
  .content.account-step .checkout-details { margin-bottom: 20px; }
  .content.account-step .checkout-footer { align-items: stretch; }
}
@media (max-width: 520px) {
  .page { align-items: flex-start; padding: 20px 14px; }
  .card { padding: 22px; border-radius: 20px; }
  .hero { margin-bottom: 22px; }
  .sample-fields { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .field input { font-size: 16px; height: 40px; }
  .mix-dropdown { width: 100%; flex: 1 1 100%; }
  .mix-panel { right: 0; width: max(100%, 220px); max-width: calc(100vw - 84px); }
  .mix-panel .mix-search { height: 40px; font-size: 16px; }
  .pkg { padding: 10px 8px; font-size: 12px; letter-spacing: 0; }
  .btn { padding: 12px 14px; font-size: 13px; }
  .cta-stack { gap: 12px; }
}
@media (max-width: 360px) {
  .page { padding: 14px 10px; }
  .card { padding: 18px; }
  .hero h1 { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
