/* WalletMe — shared look: black ink, WalletMe blue, Apple-style glass, rounded-square controls */
:root {
  --bg: #F3F5F8;
  --ink: #111215;
  --ink-2: #3A3D42;
  --muted: #646A72;
  --card: #FFFFFF;
  --line: rgba(17, 18, 21, 0.10);
  --fill: rgba(110, 118, 130, 0.12);
  --accent: #1E5EFF;
  --accent-soft: #E6EEFF;
  --accent-ink: #1544C2;
  --ok: #1E7A45;
  --danger: #B42318;
  --radius-s: 12px;
  --radius-m: 16px;
  --radius-l: 22px;
  --shadow-1: 0 1px 2px rgba(26, 23, 20, 0.06);
  --shadow-2: 0 14px 40px rgba(26, 23, 20, 0.14);
  --glass: rgba(255, 255, 255, 0.58);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-sheet: cubic-bezier(0.32, 0.72, 0, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; font-size: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
/* Taps fire at once (no double-tap zoom on the keypad); controls never select their label */
button, a, select, label, [role="button"] { touch-action: manipulation; }
button, [role="button"], .btn, .chip {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
img { display: block; }
a { color: var(--ink); }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Buttons: rounded squares, never pills */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 20px; border: 0; border-radius: var(--radius-m);
  font-size: 1rem; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: transform 120ms var(--ease-out), opacity 150ms ease, background-color 150ms ease;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn-primary { background: var(--ink); color: #FFFFFF; }
.btn-secondary { background: var(--card); color: var(--ink); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); }
.btn-accent { background: var(--accent); color: #FFFFFF; }
.btn-ghost { background: transparent; color: var(--ink); height: 44px; padding: 0 12px; font-size: 0.875rem; text-decoration: underline; text-underline-offset: 3px; }
.btn-danger-text { color: var(--danger); }
.btn-block { width: 100%; }

/* Fields */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.8125rem; font-weight: 600; }
.field .hint { font-weight: 400; color: var(--muted); }
.input, .select {
  width: 100%; height: 50px; border: 0; border-radius: 14px; background: #FFFFFF;
  box-shadow: inset 0 0 0 1px var(--line); padding: 0 16px; font-size: max(16px, 1rem); color: var(--ink);
  appearance: none; -webkit-appearance: none;
}
.input:focus, .select:focus { outline: none; box-shadow: inset 0 0 0 2px var(--ink); }
.input[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--danger); }
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236B655E' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 0.8125rem; line-height: 1.4; color: var(--ink-2); }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--ink); flex-shrink: 0; }

/* Surfaces */
.card { background: var(--card); border-radius: var(--radius-l); box-shadow: var(--shadow-1); }
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-2), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.muted { color: var(--muted); }
.error { color: var(--danger); font-size: 0.875rem; font-weight: 500; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 9px;
  background: var(--fill); font-size: 0.75rem; font-weight: 600; color: var(--ink);
}
.chip-accent { background: var(--accent-soft); color: var(--accent-ink); }

.progress { height: 8px; border-radius: 4px; background: rgba(120, 113, 104, 0.16); overflow: hidden; }
.progress > span {
  display: block; width: 100%; height: 100%; border-radius: 4px; background: var(--accent);
  transform: translateX(-100%); transition: transform 400ms var(--ease-out);
}

.spinner {
  width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgba(26, 23, 20, 0.15);
  border-top-color: var(--ink); animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.shake { animation: shake 0.35s ease; }

/* Reduced motion: no movement or scaling, keep fades and colour changes */
@media (prefers-reduced-motion: reduce) {
  *:active { transform: none !important; }
  .btn:active { opacity: 0.8; }
  .shake { animation: none; }
  .shake > * { box-shadow: inset 0 0 0 2px var(--danger) !important; }
  .progress > span { transition: none; }
}
/* Reduced transparency: frosted glass becomes solid */
@media (prefers-reduced-transparency: reduce) {
  .glass { background: #FFFFFF; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
/* More contrast: solid surfaces, defined edges, darker secondary text */
@media (prefers-contrast: more) {
  :root { --muted: #3D3935; --line: rgba(26, 23, 20, 0.45); }
  .glass { background: #FFFFFF; border-color: var(--ink); }
}
