/* Material slots, upload progress and the pre-upload disclosure.
   Scoped to the onboarding page; inherits the dark glass tokens from demo.css. */

.materials-disclosure{margin:18px 0;padding:16px 18px;border:1px solid #9de7cf3a;border-radius:6px;background:#9de7cf0e}
.materials-disclosure h3{margin:0 0 12px;color:#d8f0e5;font-size:13px}
.materials-disclosure dl{display:grid;gap:10px;margin:0}
.materials-disclosure dl>div{display:grid;grid-template-columns:104px minmax(0,1fr);gap:12px}
.materials-disclosure dt{color:#9fe7d0;font-size:11px;font-weight:700;line-height:1.6}
.materials-disclosure dd{margin:0;color:#c3d5ca;font-size:11px;line-height:1.75}
.materials-disclosure .disclosure-foot{margin:14px 0 0;color:#8fa79b;font-size:10px;line-height:1.7}

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

.material-slot{min-width:0;display:flex;flex-direction:column;gap:11px;padding:15px;border:1px solid #d6fff024;border-radius:6px;background:#e0fff008}
.material-slot.has-material{border-color:#9de7cf3d}
.material-slot.needs-changes{border-color:#e5bd7855;background:#e5bd7808}

.slot-header{display:flex;align-items:center;gap:9px}
.slot-number{color:#8fcbb8;font:10px var(--mono)}
.slot-header h4{margin:0;flex:1;color:#d8f0e5;font-size:13px}
.slot-status{padding:3px 7px;border-radius:3px;background:#d6fff014;color:#9fb6aa;font-size:10px;white-space:nowrap}
.slot-status.is-ok{background:#9de7cf1f;color:#a4e6cc}
.slot-status.is-warning{background:#e5bd7822;color:#e8cb99}

.slot-guide p{margin:3px 0;font-size:11px;line-height:1.7}
.slot-angle{color:#c3d5ca}
.slot-angle strong{color:#d8f0e5}
.slot-hint{color:#93a99d;font-size:10px}
.slot-limits{margin-top:7px!important;padding-top:7px;border-top:1px solid #d6fff014;color:#8fa79b;font-size:10px}

.slot-feedback{padding:10px 12px;border:1px solid #e5bd7855;border-radius:5px;background:#e5bd7810}
.slot-feedback strong{display:block;color:#e8cb99;font-size:11px}
.slot-feedback p{margin:5px 0 0;color:#d9c7a6;font-size:11px;line-height:1.7}
.slot-feedback .slot-feedback-hint{color:#9eb2a6;font-size:10px}

.slot-current img,.slot-current-preview{display:block;width:100%;max-height:190px;object-fit:contain;background:#071011;border-radius:4px}
.slot-receipt{display:grid;grid-template-columns:repeat(auto-fit,minmax(96px,1fr));gap:8px;margin:9px 0 0}
.slot-receipt>div{min-width:0}
.slot-receipt dt{color:#8fa79b;font-size:9px}
.slot-receipt dd{margin:2px 0 0;color:#c3d5ca;font:10px var(--mono);overflow-wrap:anywhere}

.slot-staged{display:grid;grid-template-columns:minmax(0,132px) minmax(0,1fr);gap:12px;padding:11px;border:1px solid #9de7cf33;border-radius:5px;background:#9de7cf0a}
.slot-staged-preview{display:block;width:100%;height:100%;max-height:150px;object-fit:cover;background:#071011;border-radius:4px}
.slot-staged-meta{min-width:0}
.slot-staged-meta p{margin:0 0 4px;color:#c3d5ca;font-size:11px;line-height:1.6}
.slot-staged-file{color:#8fa79b!important;font-size:10px!important;overflow-wrap:anywhere}
.slot-error{margin:7px 0!important;padding:7px 9px;border-radius:4px;background:#edb3a318;color:#f0c1b7!important;font-size:11px!important}
.slot-staged-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:9px}
.slot-privacy{margin:8px 0 0!important;color:#8fa79b!important;font-size:10px!important;line-height:1.65!important}

.slot-progress{margin:9px 0}
.slot-progress-track{position:relative;height:5px;overflow:hidden;border-radius:3px;background:#d6fff019}
.slot-progress-track>span{display:block;height:100%;background:linear-gradient(90deg,#34806a,#8bd7bd);transition:width .2s ease}
.slot-progress-track>span.is-indeterminate{width:38%;animation:slotIndeterminate 1.15s ease-in-out infinite}
.slot-progress-text{display:block;margin-top:5px;color:#9fb6aa;font-size:10px}
.slot-progress.is-verifying .slot-progress-text{color:#e8cb99}

.slot-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:auto;padding-top:4px}
.slot-actions .file-picker-button{position:relative;display:inline-flex;align-items:center;justify-content:center;min-height:36px;padding:8px 12px;border:1px solid #d8fff039;border-radius:3px;background:#d8fff00b;color:#e2eee6;font-size:11px;font-weight:700;cursor:pointer}
.slot-actions .file-picker-button:hover{background:#d8fff018}
.slot-actions .file-picker-button input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.slot-actions .file-picker-button.is-disabled{opacity:.45;cursor:not-allowed}
.slot-actions .file-picker-button:focus-within{outline:2px solid #b4f0dd;outline-offset:2px}
.slot-actions .text-button{min-height:36px}

@keyframes slotIndeterminate{
  0%{transform:translateX(-110%)}
  100%{transform:translateX(280%)}
}

@media(max-width:760px){
  .account-material-grid{grid-template-columns:1fr}
  .materials-disclosure{padding:13px 14px}
  .materials-disclosure dl>div{grid-template-columns:1fr;gap:3px}
  .slot-staged{grid-template-columns:1fr}
  .slot-staged-preview{max-height:210px;object-fit:contain}
}

@media(prefers-reduced-motion:reduce){
  .slot-progress-track>span{transition:none}
  .slot-progress-track>span.is-indeterminate{animation:none;width:100%;opacity:.5}
}

/* ---- Interactive consent for the three reviewed documents ---- */

.consent-group{min-width:0;margin:0 0 14px;padding:14px 16px;border:1px solid #d6fff024;border-radius:6px;background:#e0fff008}
.consent-group legend{display:flex;flex-wrap:wrap;align-items:baseline;gap:8px;padding:0;margin-bottom:8px;color:#d8f0e5;font-size:13px;line-height:1.6}
.consent-group .field-guidance{margin:0 0 10px;color:#9eb2a6;font-size:11px;line-height:1.7}
.consent-group.is-missing{border-left:3px solid #d5b477;background:#d5b4770a}
.consent-group .consent-item{margin:0;border:0;background:none;padding:0}

.scope-choices .scope-group{min-width:0;margin:0 0 12px;padding:14px;border:1px solid #a1dbc031;border-radius:6px;background:#09161355}
.scope-choices .scope-group legend{display:flex;flex-wrap:wrap;align-items:baseline;gap:8px;color:#d8f0e5;font-size:13px;padding:0 4px;margin-bottom:6px}
.scope-choices .scope-group.is-missing{border-left:3px solid #d5b477}
.scope-choices .scope-group:focus-within{outline:2px solid #b4f0dd;outline-offset:2px}
.scope-choices .field-guidance{margin:0 0 10px;color:#9eb2a6;font-size:11px;line-height:1.7}

.consent-declined-card{border-color:#e5bd7855;background:#e5bd780d}
.consent-declined-card strong{color:#e8cb99}
.consent-declined{max-width:560px;padding:16px;border:1px solid #e5bd7855;border-radius:6px;background:#e5bd780d}
.consent-declined h3{margin:0 0 10px;color:#e8cb99;font-size:14px}
.consent-declined p{margin:0 0 8px;color:#c3d5ca;font-size:12px;line-height:1.75}

@media(max-width:760px){
  .consent-group{padding:12px 13px}
  .consent-group legend{font-size:12px}
  .scope-choices .scope-group{padding:11px}
}

/* The segmented control hides the native radio behind its label, so the
   label must forward clicks. Without this the control is unclickable. */
.segmented-choice{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:10px 0 0}
.segmented-choice label{position:relative;display:block;cursor:pointer}
.segmented-choice input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.segmented-choice span{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:0 2px;min-height:40px;padding:8px 10px;border:1px solid #d5fff02d;border-radius:4px;background:#d5fff009;color:#b9ccc1;font-size:12px;text-align:center;line-height:1.5;transition:border-color .15s,background .15s}
.segmented-choice label:hover span{border-color:#9de7cf55}
.segmented-choice input:checked+span{border-color:#9de7cf;background:#9de7cf2d;color:#e2fff5}
.segmented-choice input:focus-visible+span{outline:2px solid #b4f0dd;outline-offset:2px}

@media(max-width:760px){
  .segmented-choice{grid-template-columns:1fr}
}

.document-confirm-footer .feedback-note{margin:6px 0 0;max-width:520px;color:#c3d5ca;font-size:11px;line-height:1.65}

/* ---- Identity step: two fields, one button ---- */

.id-form{margin:16px 0;padding:16px 18px;border:1px solid #d6fff024;border-radius:6px;background:#e0fff008}
.id-form h3{margin:0 0 6px;color:#d8f0e5;font-size:15px}
.id-form-hint{margin:0 0 14px;color:#9eb2a6;font-size:12px;line-height:1.7}
.id-form .form-field{display:block;margin-bottom:12px}
.id-form .form-field>span{display:block;margin-bottom:6px;color:#d2e3d9;font-size:12px}
.id-form .form-field input{width:100%;min-height:44px;padding:10px 12px;border:1px solid #d6fff02b;border-radius:4px;background:#d9fff00c;color:#edf5ef;font-size:15px;letter-spacing:.02em}
.id-form .form-field input::placeholder{color:#91a89b;font-size:14px}
.id-form .primary-button{width:100%;min-height:44px;font-size:14px}
.id-form .inline-note{margin:10px 0 0}

@media(max-width:760px){
  .id-form{padding:14px}
  .id-form .form-field input{font-size:16px} /* 16px avoids iOS zoom-on-focus */
}

/* ---- Mobile ergonomics -------------------------------------------------
   Measured at 320 and 390 wide: no horizontal overflow, but tap targets were
   29-38px and inputs rendered at 10-12px. Small targets miss, and sub-16px
   inputs make iOS zoom the page on focus, which loses the person's place.
   This block is loaded after demo.css so it wins without editing the
   original stylesheet. */

@media(max-width:760px){
  /* 16px is the threshold below which iOS Safari zooms on focus. */
  .form-field input,
  .form-field select,
  .form-field textarea,
  .price-input input,
  .id-form .form-field input{
    font-size:16px;
    min-height:46px;
  }

  /* Comfortable targets: 44px is the platform guidance on both iOS and Android. */
  .tag,
  .mini-button,
  .text-button,
  .primary-button,
  .secondary-button,
  .file-picker-button,
  .slot-actions .file-picker-button,
  .segmented-choice span,
  .missing-link{
    min-height:44px;
  }
  .tag{padding:10px 12px;font-size:13px}
  .mini-button{padding:10px 12px;font-size:12px}
  .primary-button,.secondary-button{padding:11px 16px;font-size:13px}

  /* Checkboxes are tapped, not aimed at. */
  .consent-item input[type=checkbox],
  .scope-chip input[type=checkbox]{
    width:20px;
    height:20px;
    margin-right:8px;
  }
  .consent-item{padding:12px;font-size:13px;line-height:1.6}

  /* Keep the step footer clear of the home indicator. */
  .step-footer{
    padding-bottom:calc(10px + env(safe-area-inset-bottom, 0px));
  }
  .page-shell{padding-bottom:calc(22px + env(safe-area-inset-bottom, 0px))}

  /* Dialogs must not sit under the notch or the home bar. */
  .themed-dialog{
    padding-bottom:env(safe-area-inset-bottom, 0px);
  }
  .dialog-footer{
    padding-bottom:calc(12px + env(safe-area-inset-bottom, 0px));
  }
}

/* Keyboard focus must be visible; the dark theme otherwise swallows it. */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
[tabindex]:focus-visible{
  outline:2px solid #b4f0dd;
  outline-offset:2px;
  border-radius:3px;
}

/* Respect the reader who asked for less motion. */
@media(prefers-reduced-motion:reduce){
  .slot-progress-track>span,
  .slot-progress-track>span.is-indeterminate{
    transition:none;
    animation:none;
  }
}

@media(max-width:760px){
  /* The dialog close control was 33px, which is a miss on a phone. */
  .icon-button{
    min-width:44px;
    min-height:44px;
  }
}

/* A rejected quote must say so where the number is, not at the bottom of the
   page after a round-trip that looks like a dead button. */
.quote-error{display:block;margin-top:5px;color:#f0c1b7;font-size:11px;font-style:normal;line-height:1.5}
.price-input:has(.quote-error) input{border-color:#e8a294}
.price-input:has(.quote-error) input:focus{border-color:#f0c1b7}

/* 附件一 "其他" input and the confirmed-copy block */
.scope-other{margin-top:8px}
.scope-other-input{width:100%;min-height:38px;padding:9px 11px;border:1px dashed #d5fff02d;border-radius:4px;background:#d5fff008;color:#e6f5ed;font-size:12px}
.scope-other-input::placeholder{color:#8fa99b}
.scope-other-input:focus{border-color:#9de7cf66;outline:none}
.contract-copy{margin-top:14px;padding:13px;border:1px solid #9de7cf3a;background:#9de7cf0e;border-radius:4px}
.contract-copy p{margin:0 0 10px;color:#cfe5d9;font-size:12px;line-height:1.6}
.contract-copy .primary-button{display:inline-block;text-decoration:none}

/* ---- Chapter 8 consents: one big tap target per choice ---- */
.consent-lead{margin:12px 0 14px;padding:12px 14px;border-left:3px solid #8de1c7;border-radius:4px;background:#8de1c712;color:#d6ecdf;font-size:13px;line-height:1.7}
.privacy-consent .consent-group{margin:12px 0;border:0;padding:0}
.consent-option{display:flex;gap:13px;align-items:flex-start;min-height:64px;padding:15px 16px;border:1px solid #d5fff02d;border-radius:8px;background:#d5fff008;cursor:pointer;user-select:none;-webkit-user-select:none;transition:border-color .15s,background .15s}
.consent-option:hover{border-color:#9de7cf66;background:#9de7cf12}
.consent-option:has(input:checked){border-color:#9de7cf;background:#9de7cf1f}
.consent-option input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.consent-box{position:relative;flex:0 0 auto;width:26px;height:26px;margin-top:1px;border:2px solid #7f9c8d;border-radius:7px;background:#0e1a17;transition:border-color .15s,background .15s}
.consent-option:hover .consent-box{border-color:#9de7cf}
.consent-option input:checked+.consent-box{border-color:#8de1c7;background:#8de1c7}
.consent-option input:checked+.consent-box::after{content:'';position:absolute;left:8px;top:3px;width:6px;height:13px;border:solid #0d1918;border-width:0 3px 3px 0;transform:rotate(45deg)}
.consent-option input:focus-visible+.consent-box{outline:2px solid #b4f0dd;outline-offset:2px}
.consent-copy{flex:1;min-width:0;color:#dcefe4;font-size:13px;line-height:1.7}
.consent-copy strong{color:#eafff5}
.consent-choice{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.choice-card{position:relative;display:flex;gap:11px;align-items:center;min-height:64px;padding:15px 16px;border:1px solid #d5fff02d;border-radius:8px;background:#d5fff008;cursor:pointer;user-select:none;-webkit-user-select:none;transition:border-color .15s,background .15s}
.choice-card:hover{border-color:#9de7cf66;background:#9de7cf12}
.choice-card input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.choice-mark{flex:0 0 auto;display:grid;place-items:center;width:28px;height:28px;border:2px solid #7f9c8d;border-radius:50%;color:transparent;font-size:14px;font-weight:700;line-height:1}
.choice-yes input:checked+.choice-mark{border-color:#8de1c7;background:#8de1c7;color:#0d1918}
.choice-no input:checked+.choice-mark{border-color:#e8a294;background:#e8a294;color:#2a1410}
.choice-card input:focus-visible+.choice-mark{outline:2px solid #b4f0dd;outline-offset:2px}
.choice-yes:has(input:checked){border-color:#9de7cf;background:#9de7cf1f}
.choice-no:has(input:checked){border-color:#e8a294;background:#e8a2941f}
.choice-text{font-size:13px;line-height:1.65;color:#dcefe4}
.consent-note{margin:10px 0;padding:12px 14px;border:1px dashed #d5fff02d;border-radius:6px;background:#d5fff005;color:#a9c0b4;font-size:12px;line-height:1.7}
.consent-note-text{margin:0}
.consent-note-hint{margin:6px 0 0;color:#8fa99b;font-size:11px}
.privacy-consent .consent-group.is-missing .consent-option,.privacy-consent .consent-group.is-missing .choice-card{border-color:#e5bd78}

/* ---- Chapter 8: read first, confirm everything at the end ---- */
.consent-panel{margin:22px 0 6px;padding:16px;border:1px solid #9de7cf3a;border-radius:8px;background:#0e1a1773}
.consent-panel-head strong{display:block;color:#eafff5;font-size:15px}
.consent-panel-note{margin:6px 0 12px;color:#a9c0b4;font-size:12px;line-height:1.7}
.consent-sub{margin:15px 0 4px;color:#b9d2c5;font-size:12px}
.consent-row{position:relative;display:flex;gap:12px;align-items:flex-start;min-height:46px;margin:8px 0;padding:11px 12px;border:1px solid #d5fff024;border-radius:6px;background:#d5fff006;cursor:pointer;user-select:none;-webkit-user-select:none;transition:border-color .15s,background .15s}
.consent-row:hover{border-color:#9de7cf55;background:#9de7cf0d}
.consent-row:has(input:checked){border-color:#9de7cf;background:#9de7cf14}
.consent-row input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.consent-box{position:relative;flex:0 0 auto;width:20px;height:20px;margin-top:1px;border:2px solid #7f9c8d;border-radius:6px;background:#0e1a17}
.consent-row:hover .consent-box{border-color:#9de7cf}
.consent-row input:checked+.consent-box{border-color:#8de1c7;background:#8de1c7}
.consent-row input:checked+.consent-box::after{content:'';position:absolute;left:6px;top:1px;width:5px;height:10px;border:solid #0d1918;border-width:0 2.5px 2.5px 0;transform:rotate(45deg)}
.consent-row input:focus-visible+.consent-box{outline:2px solid #b4f0dd;outline-offset:2px}
.consent-row.consent-row-no:has(input:checked){border-color:#e8a294;background:#e8a29414}
.consent-row.consent-row-no input:checked+.consent-box{border-color:#e8a294;background:#e8a294}
.consent-row.consent-row-no input:checked+.consent-box::after{display:none}
.consent-copy{flex:1;min-width:0;color:#dcefe4;font-size:13px;line-height:1.7}
.consent-row-disabled{cursor:default;border-style:dashed;background:transparent}
.consent-row-disabled .consent-copy{color:#a9c0b4}
.consent-row.is-missing{border-color:#e5bd78}
@media(max-width:760px){
  .consent-panel{padding:13px;margin:18px 0 4px}
  .consent-row{min-height:48px;padding:12px}
}
@media(max-width:760px){
  .consent-option,.choice-card{min-height:56px;padding:13px 14px}
  .consent-choice{grid-template-columns:1fr}
}
