@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap');

:root {
  color-scheme: light;
  --ink: #111a31;
  --muted: #8291ac;
  --blue: #245cf4;
  --line: #dce4f0;
  --soft: #f7f9fc;
  --green: #008b62;
}

* { box-sizing: border-box; }

/* Keep HTML's hidden state authoritative when component styles set display. */
[hidden] { display: none !important; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  background: #fff;
}

.site-header {
  display:flex; align-items:center; justify-content:space-between; gap:24px;
  height:120px;
  padding:0 max(24px, calc((100% - 1200px) / 2));
}

.brand { display:flex; align-items:center; height:100%; padding:1px 0; flex:1; min-width:0; }
/* Size by height only so the logo keeps its proportions and never stretches. */
.brand img { display:block; height:104px; width:auto; max-width:100%; object-fit:contain; }

.account-actions { display: flex; align-items: center; gap: 24px; }
.account-actions a, .account-actions .login-link { color: var(--blue); text-decoration: none; font: 700 14px 'DM Sans', sans-serif; }
.account-actions .login-link { padding: 0; border: 0; background: transparent; cursor: pointer; }
.account-actions .signup-link { min-height: 40px; display: inline-flex; align-items: center; padding: 0 18px; border-radius: 12px; background: var(--blue); color: #fff; }
.account-actions a:focus-visible, .account-actions .login-link:focus-visible, .brand:focus-visible { outline: 3px solid #8eb1ff; outline-offset: 3px; border-radius: 5px; }

.page-shell {
  min-height: calc(100vh - 120px);
  background: linear-gradient(112deg, #1b2f72 0%, #244fca 54%, #3478e9 100%);
  padding: 24px;
  display: grid;
  place-items: center;
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.page-shell::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: -8%;
  opacity: .18;
  background-image: url('../images/dojo-logo.png');
  background-size: 128px 128px;
  background-repeat: repeat;
}


.form-card {
  width: min(100%, 670px);
  padding: 34px 36px 26px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 80px #0d225b45;
}

.form-header { text-align: center; margin-bottom: 28px; }
.eyebrow { margin: 0 0 7px; color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; }
h1 { margin: 0; font: 800 25px/1.25 'Manrope', sans-serif; letter-spacing: -.7px; }
.intro { margin: 7px 0 0; color: var(--muted); font-size: 13px; }

.field { min-width: 0; margin-bottom: 16px; }
.field label { display: block; margin-bottom: 8px; color: #33415c; font-size: 13px; font-weight: 700; }
.field label span { color: #91a0b8; font-weight: 400; }
.field input:not([type=file]), .field textarea, .field select {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font: 400 14px 'DM Sans', sans-serif;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 88px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #9aa7bb; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: #6c95ff; box-shadow: 0 0 0 3px #245cf41a; }
.field input[readonly] { background: var(--soft); color: #394965; font-weight: 600; }
.helper { display: block; margin-top: 7px; color: var(--blue); font-size: 12px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.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; }
.upload-box { min-height: 132px; overflow: hidden; }
#upload-empty:not([hidden]) { min-height: 132px; display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
#upload-empty .upload-choice { appearance: none; -webkit-appearance: none; width: 100%; min-width: 0; min-height: 132px; display: flex !important; align-items: center; justify-content: center; flex-direction: column; gap: 5px; padding: 14px 8px; border: 1px dashed #c5d4ed; border-radius: 12px; background: #f7faff; color: var(--muted); cursor: pointer; font: 400 12px 'DM Sans', sans-serif; text-align: center; white-space: normal; transition: border-color .15s, background .15s, transform .15s; }
#upload-empty .upload-choice:hover { border-color: #7da2ff; background: #f0f5ff; transform: translateY(-1px); }
#upload-empty .upload-choice strong { margin-top: 5px; color: #25324c; font-size: 13px; }
.upload-preview img { display: block; max-width: min(100%, 300px); max-height: 170px; object-fit: contain; border-radius: 6px; }
.upload-preview { position: relative; min-height: 144px; display: flex; align-items: center; justify-content: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #f7f9fc; }
.preview-actions { position: absolute; top: 10px; right: 10px; display: flex; gap: 8px; }
.status-pill { position: absolute; bottom: 10px; left: 10px; padding: 7px 10px; border-radius: 9px; background: #e7faf2; color: #007a54; font-size: 11px; font-weight: 700; }
.upload-error { margin: 7px 0 0; color: #bd2539; font-size: 12px; }

.button, .icon-button { border: 0; cursor: pointer; font: 700 13px 'DM Sans', sans-serif; }
.button { min-height: 38px; display: inline-flex; justify-content: center; align-items: center; gap: 9px; padding: 0 15px; border-radius: 9px; }
.button-secondary { border: 1px solid #d9e3f0; background: #fff; color: var(--blue); box-shadow: 0 2px 5px #17294d0a; }
.button-secondary:hover { background: #f4f7ff; }
.button-primary { background: var(--blue); color: #fff; box-shadow: 0 5px 12px #245cf42e; }
.button-primary:hover { background: #174de2; }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: #5e6d85; font-size: 20px; }

.ready-banner { min-height: 48px; display: flex; align-items: center; gap: 11px; padding: 10px 13px; border: 1px solid #98edce; border-radius: 11px; background: #edfbf5; color: #167858; }
.ready-banner p { margin: 0; font-size: 12px; line-height: 1.5; }
.ready-banner strong { margin-right: 4px; font-size: 13px; }
.check-icon { flex: 0 0 22px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: #00a875; color: #fff; font-weight: 800; }
.collect-button { width: 100%; min-height: 52px; margin-top: 13px; font-size: 15px; }
.privacy-note { margin: 14px 0 0; color: #9ba9bd; text-align: center; font-size: 11px; }

.completion-shell { min-height: calc(100vh - 120px); }
.completion-card {
  width: min(100%, 672px);
  min-height: 568px;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  padding: 48px 32px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 80px #0d225b45;
  text-align: center;
}
.completion-check {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 7px 14px #245cf43a;
  color: #fff;
  font-size: 27px;
  font-weight: 600;
}
.completion-card h1 { margin: 0; }
.completion-card p { max-width: 340px; margin: 14px 0 34px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.completion-card .button { min-height: 44px; padding: 0 20px; text-decoration: none; }

/* Admin sign-in dialog sits above the public form and dismisses without navigation. */
.admin-login-modal {
  width: min(504px, calc(100% - 32px));
  max-width: none;
  padding: 34px 32px 30px;
  border: 0;
  border-radius: 12px;
  color: var(--ink);
  box-shadow: 0 24px 80px #0d225b45;
}
.admin-login-modal::backdrop { background: #111a31a8; backdrop-filter: blur(2px); }
.admin-login-modal h2 { margin: 0; color: #123d5a; text-align: center; font: 800 21px/1.3 'Manrope', sans-serif; text-transform: uppercase; }
.admin-login-intro { margin: 8px 0 24px; color: var(--muted); text-align: center; font-size: 13px; }
.admin-login-intro.is-notice { padding: 10px 12px; border-radius: 9px; background: #eef3ff; color: #123d5a; font-weight: 700; }
.admin-login-close { position: absolute; top: 11px; right: 13px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: #60708c; cursor: pointer; font: 400 25px/1 'DM Sans', sans-serif; }
.admin-login-close:hover { background: #f1f4fa; color: var(--ink); }
.admin-login-field { margin-top: 16px; }
.admin-login-field label { display: block; margin-bottom: 7px; color: #111827; font-size: 13px; font-weight: 700; }
.admin-login-field label span { color: #df3344; }
.admin-login-field input { width: 100%; min-height: 46px; padding: 0 13px; border: 1px solid #d8e0ed; border-radius: 9px; background: #fff; color: var(--ink); font: 400 14px 'DM Sans', sans-serif; }
.admin-login-field input:focus { outline: 3px solid #245cf41a; border-color: #6c95ff; }
.admin-login-submit { display: flex; min-width: 92px; margin: 23px auto 0; }
.admin-login-error { margin: 15px 0 0; color: #bd2539; text-align: center; font-size: 12px; }

@media (max-width: 600px) {
  .admin-login-modal { padding: 32px 22px 25px; }
}

@media (max-width: 600px) {
  .site-header { height:88px; padding:0 16px; gap:12px; }
  .brand img { height:72px; }
  .account-actions { gap:14px; }
  .account-actions .signup-link { padding:0 14px; }
  .page-shell { min-height: calc(100vh - 88px); padding:16px 12px; align-items:start; }
  .completion-card { min-height: 440px; padding: 36px 22px; }
  .form-header { margin-bottom: 22px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  #upload-empty:not([hidden]) { gap: 8px; }
  #upload-empty .upload-choice { padding: 12px 5px; font-size: 11px; }
  #upload-empty .upload-choice strong { font-size: 12px; }
  .intro { font-size: 12px; }
}


/* Small source chooser used by the mobile Take Picture action. */
.photo-source-modal {
  position: relative;
  width: min(440px, calc(100% - 32px));
  max-width: none;
  padding: 34px 26px 26px;
  border: 0;
  border-radius: 16px;
  color: var(--ink);
  box-shadow: 0 24px 80px #0d225b45;
}
.photo-source-modal::backdrop { background: #111a31a8; backdrop-filter: blur(2px); }
.photo-source-modal h2 { margin: 0; padding-right: 22px; font: 800 19px/1.3 'Manrope', sans-serif; }
.photo-source-modal p { margin: 9px 0 22px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.photo-source-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.photo-source-actions .button { min-height: 46px; }
@media (max-width: 600px) {
  .form-card { padding: 28px 18px 22px; border-radius: 15px; }
  .site-header { gap: 8px; }
  .account-actions { gap: 10px; }
  .account-actions a, .account-actions .login-link { font-size: 12px; }
  .account-actions .signup-link { min-height: 38px; padding: 0 12px; }
  .photo-source-modal { padding: 32px 20px 22px; }
  .photo-source-actions { grid-template-columns: 1fr; }
  .photo-source-actions .button { width: 100%; min-height: 48px; }
  .upload-preview { min-height: 190px; padding: 52px 10px 42px; }
  .upload-preview img { max-width: 100%; max-height: 190px; }
  .preview-actions { top: 8px; right: 8px; }
  .status-pill { bottom: 8px; left: 8px; }
}

/* Sign-up: three-step form with a progress indicator. */
.signup-card { width: min(100%, 560px); }
.signup-steps { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin: 0 0 26px; padding: 0; list-style: none; }
.signup-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; color: #9aa7bb; font-size: 12px; font-weight: 700; text-align: center; }
/* The connector into each step fills in once that step is reached. */
.signup-step:not(:first-child)::before { content: ''; position: absolute; top: 15px; right: calc(50% + 20px); width: calc(100% - 40px); height: 3px; border-radius: 3px; background: var(--line); transition: background .3s; }
.signup-step.is-done:not(:first-child)::before, .signup-step.is-current:not(:first-child)::before { background: var(--blue); }
.signup-step-dot { position: relative; z-index: 1; width: 32px; height: 32px; display: grid; place-items: center; border: 2px solid var(--line); border-radius: 50%; background: #fff; color: #9aa7bb; font-size: 13px; transition: background .25s, border-color .25s, color .25s, box-shadow .25s; }
.signup-step.is-current { color: var(--ink); }
.signup-step.is-current .signup-step-dot { border-color: var(--blue); color: var(--blue); box-shadow: 0 0 0 5px #245cf41f; }
.signup-step.is-done { color: #33415c; }
.signup-step.is-done .signup-step-dot { border-color: var(--blue); background: var(--blue); color: #fff; font-size: 0; }
.signup-step.is-done .signup-step-dot::after { content: '✓'; font-size: 15px; }

.signup-panel { min-width: 0; margin: 0 0 6px; padding: 0; border: 0; }
.signup-panel-title { margin-bottom: 14px; padding: 0; color: #33415c; font: 800 15px 'Manrope', sans-serif; }
.signup-form.is-stepped .signup-panel:not(.is-active) { display: none; }
.signup-form.is-stepped .signup-panel.is-active { animation: signup-step-in .25s ease-out; }
@keyframes signup-step-in { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .signup-form.is-stepped .signup-panel.is-active { animation: none; } .signup-step-dot, .signup-step::before { transition: none; } }
.field-hint { display: block; margin-top: 7px; color: #8c9bb4; font-size: 12px; line-height: 1.45; }

.password-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: -4px 0 12px; padding: 0; list-style: none; color: #8c9bb4; font-size: 12px; }
.password-checks li { display: flex; align-items: center; gap: 7px; transition: color .2s; }
.password-checks li::before { content: ''; width: 16px; height: 16px; display: grid; place-items: center; border: 2px solid var(--line); border-radius: 50%; font-size: 10px; font-weight: 800; transition: background .2s, border-color .2s; }
.password-checks li.is-met { color: var(--green); }
.password-checks li.is-met::before { content: '✓'; border-color: #00a875; background: #00a875; color: #fff; }

.signup-owner-note { margin: 0 0 16px; padding: 12px 14px; border-radius: 11px; background: #eef3ff; color: #33415c; font-size: 13px; line-height: 1.55; }
.signup-summary { margin: 0 0 8px; border: 1px solid var(--line); border-radius: 11px; }
.signup-summary div { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 14px; }
.signup-summary div + div { border-top: 1px solid var(--line); }
.signup-summary dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.signup-summary dd { margin: 0; overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.signup-summary button { padding: 4px 6px; border: 0; border-radius: 6px; background: none; color: var(--blue); cursor: pointer; font: 700 12px 'DM Sans', sans-serif; }
.signup-summary button:hover { background: #f0f5ff; }

.signup-actions { display: flex; gap: 10px; margin-top: 12px; }
.signup-actions .button { min-height: 48px; flex: 1; font-size: 14px; }
.signup-actions .button-secondary { flex: 0 0 auto; padding: 0 20px; }
.signup-actions .button:disabled { opacity: .7; cursor: progress; }
.signup-error { margin: 0 0 18px; padding: 11px 14px; border-radius: 11px; background: #fdeef0; color: #bd2539; font-size: 13px; }
.signup-notice { display: grid; gap: 16px; justify-items: center; padding: 18px; border-radius: 12px; background: #eef3ff; color: #33415c; font-size: 13px; line-height: 1.6; text-align: center; }
.signup-notice p { margin: 0; }
.signup-notice .button { min-height: 44px; padding: 0 20px; text-decoration: none; }
.signup-footer { margin: 18px 0 0; color: var(--muted); text-align: center; font-size: 13px; }
.signup-footer a, .admin-login-footer a { color: var(--blue); font-weight: 700; text-decoration: none; }
.admin-login-footer { margin: 16px 0 0; color: var(--muted); text-align: center; font-size: 12px; }
@media (max-width: 600px) {
  .signup-step-label { font-size: 11px; }
  .signup-summary div { grid-template-columns: 76px minmax(0, 1fr) auto; padding: 10px 12px; }
}

/* Sign-up account type choice. */
.account-type-options { display: grid; gap: 12px; }
.account-type-option { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px; border: 1.5px solid var(--line); border-radius: 13px; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.account-type-option:hover { border-color: #9db8ff; background: #f8faff; }
.account-type-option input { position: absolute; opacity: 0; pointer-events: none; }
.account-type-option:has(input:checked) { border-color: var(--blue); background: #f3f7ff; box-shadow: 0 0 0 3px #245cf41a; }
.account-type-option:has(input:focus-visible) { outline: 3px solid #8eb1ff; outline-offset: 2px; }
.account-type-icon { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 11px; background: #eef3ff; color: var(--blue); }
.account-type-icon svg, .verify-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.account-type-copy { display: grid; gap: 3px; }
.account-type-copy strong { color: var(--ink); font-size: 14px; }
.account-type-copy small { color: var(--muted); font-size: 12px; line-height: 1.45; }

/* Owner email verification. */
.verify-card { width: min(100%, 460px); }
.verify-icon { width: 52px; height: 52px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 50%; background: #eef3ff; color: var(--blue); }
.verify-code-input { text-align: center; letter-spacing: .5em; font-size: 22px !important; font-weight: 700 !important; }
.verify-resend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin: 16px 0 0; color: var(--muted); font-size: 13px; }
.verify-resend button { padding: 0; border: 0; background: none; color: var(--blue); cursor: pointer; font: 700 13px 'DM Sans', sans-serif; }
.verify-resend button:disabled { color: var(--muted); cursor: default; }
.signup-success { margin: 0 0 18px; padding: 11px 14px; border-radius: 11px; background: #edfbf5; color: #137858; font-size: 13px; }

/* Home page without a capture link. */
.landing-card { text-align: center; }
.landing-card .intro { max-width: 380px; margin-left: auto; margin-right: auto; line-height: 1.6; }
.landing-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }
.landing-actions .button { min-height: 46px; padding: 0 22px; text-decoration: none; font-size: 14px; }

.site-header { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; }

/* Capture page header buttons: one size, colour says what each does. */
.header-actions { display: flex; align-items: center; gap: 12px; }
.header-form { display: contents; }
.header-btn {
  position: relative; overflow: hidden; isolation: isolate;
  min-width: 140px; height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 0 20px; border: 1px solid transparent; border-radius: 999px;
  font: 700 14px 'DM Sans', sans-serif; letter-spacing: .01em; text-decoration: none; cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.header-btn svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .18s ease; }
/* Soft sheen that sweeps across on hover. */
.header-btn::after { content: ''; position: absolute; z-index: -1; inset: 0; background: linear-gradient(110deg, transparent 30%, #ffffff40 50%, transparent 70%); transform: translateX(-120%); transition: transform .5s ease; }
.header-btn:hover { transform: translateY(-2px); }
.header-btn:hover::after { transform: translateX(120%); }
.header-btn:hover svg { transform: translateX(2px); }
.header-btn:active { transform: translateY(0); filter: brightness(.96); }
.header-btn:focus-visible { outline: 3px solid #8eb1ff; outline-offset: 3px; }
.header-btn--primary { background: linear-gradient(135deg, #3b74ff 0%, #245cf4 55%, #1a45d1 100%); color: #fff; box-shadow: 0 6px 16px #245cf440, inset 0 1px 0 #ffffff33; }
.header-btn--primary:hover { box-shadow: 0 10px 22px #245cf452, inset 0 1px 0 #ffffff33; }
.header-btn--danger { background: linear-gradient(135deg, #f0565f 0%, #e03440 55%, #c42532 100%); color: #fff; box-shadow: 0 6px 16px #e0344038, inset 0 1px 0 #ffffff33; }
.header-btn--danger:hover { box-shadow: 0 10px 22px #e034404d, inset 0 1px 0 #ffffff33; }
.header-btn--ghost { border-color: #d6e0f5; background: #fff; color: #245cf4; box-shadow: 0 4px 12px #14264b12; }
.header-btn--ghost::after { background: linear-gradient(110deg, transparent 30%, #245cf414 50%, transparent 70%); }
.header-btn--ghost:hover { border-color: #9db8ff; box-shadow: 0 8px 18px #245cf424; }
@media (prefers-reduced-motion: reduce) {
  .header-btn, .header-btn svg, .header-btn::after { transition: none; }
  .header-btn:hover { transform: none; }
}
@media (max-width: 600px) {
  .header-actions { gap: 8px; }
  .header-btn { min-width: 0; flex: 1; height: 42px; padding: 0 14px; font-size: 13px; }
}

/* Capture form location picker: native select with a custom chevron. */
.field select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer; }
.select-wrap { position: relative; }
.select-wrap::after { content: ''; position: absolute; top: 50%; right: 16px; width: 8px; height: 8px; border-right: 2px solid #7a89a3; border-bottom: 2px solid #7a89a3; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.helper a { color: inherit; font-weight: 700; }

/* Location set by a /leads/<location> or /c/<id>/<location> link. */
.locked-location { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 14px; border: 1px solid #c9d8fb; border-radius: 11px; background: #f3f7ff; color: #1f3f99; font-size: 14px; font-weight: 700; }
.locked-location svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.location-missing { margin: 0 0 16px; padding: 11px 14px; border-radius: 11px; background: #fff7e6; color: #8a5a00; font-size: 13px; }

/* Details read off a business card (job title, website, address). */
.card-extras { margin-bottom: 4px; padding: 14px 14px 2px; border: 1px dashed #c9d8fb; border-radius: 12px; background: #f8faff; }
.card-extras-title { margin: 0 0 10px; color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }

/* Live business-card scanner (card-scanner.js). */
.card-scanner { width: min(560px, 100vw); max-width: none; max-height: 100dvh; margin: auto; padding: 0; border: 0; border-radius: 18px; background: #0b1020; color: #fff; overflow: hidden; }
.card-scanner::backdrop { background: #060913e6; }
.scanner-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.scanner-top h2 { margin: 0; font: 800 16px 'Manrope', sans-serif; }
.scanner-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #ffffff1f; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.scanner-stage { position: relative; width: 100%; aspect-ratio: 4 / 3; max-height: 70dvh; margin: 0 auto; background: #000; overflow: hidden; }
.scanner-stage video { display: block; width: 100%; height: 100%; object-fit: contain; }
/* Card-shaped guide; the area outside it is dimmed by its own huge shadow. */
.scanner-guide { position: absolute; left: 7%; top: 25%; width: 86%; height: 49%; border: 3px solid #ffffffcc; border-radius: 14px; box-shadow: 0 0 0 9999px #00000080; transition: border-color .2s; }
.scanner-guide[data-state="moving"] { border-color: #ffd166; }
.scanner-guide[data-state="steady"], .scanner-guide[data-state="captured"] { border-color: #2ee59d; }
.scanner-guide[data-state="error"] { border-color: #ff6b6b; }
.scanner-progress { position: absolute; left: 0; right: 0; bottom: -3px; height: 5px; border-radius: 0 0 12px 12px; background: #2ee59d; transform: scaleX(0); transform-origin: left; transition: transform .12s linear; }
.scanner-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.scanner-flash.is-flashing { animation: scanner-flash .35s ease-out; }
@keyframes scanner-flash { from { opacity: .85; } to { opacity: 0; } }
.scanner-status { min-height: 22px; margin: 12px 16px 0; color: #dbe4ff; text-align: center; font-size: 14px; }
.scanner-actions { display: flex; gap: 10px; padding: 14px 16px 18px; }
.scanner-actions .button { flex: 1; min-height: 46px; }
.scanner-actions .button:disabled { opacity: .5; }
@media (max-width: 600px) {
  .card-scanner { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; display: flex; flex-direction: column; }
  .card-scanner:not([open]) { display: none; }
  .scanner-stage { flex: 1; max-height: none; }
}
@media (prefers-reduced-motion: reduce) {
  .scanner-flash.is-flashing { animation: none; }
  .scanner-progress { transition: none; }
}

/* iPhone Safari zooms into any text box under 16px when it's tapped (the login
   form, the capture form), and stays zoomed. 16px on phones avoids that. */
@media (max-width: 800px) {
  input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { font-size: 16px !important; }
}
