:root, [data-theme="light"] {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem; --space-6: 1.5rem; --space-8: 2rem;
  --color-bg: #f7f6f2; --color-surface: #fbfaf7; --color-surface-2: #ffffff; --color-surface-offset: #f1eee8; --color-border: #ddd8cd;
  --color-text: #1f257a; --color-text-muted: #5c618f; --color-text-faint: #8c90af; --color-text-inverse: #f9f8f4;
  --color-primary: #1f257a; --color-primary-hover: #151a5c; --color-primary-soft: #e8eaf9; --color-primary-highlight: #dbe0fb;
  --color-gold: #f2c300; --color-gold-soft: #fff4bf; --color-success: #2d6f3a; --color-error: #b93a3a; --color-warning: #9a6400;
  --radius-sm: 0.5rem; --radius-md: 0.9rem; --radius-lg: 1.25rem;
  --shadow-sm: 0 2px 8px rgba(31,37,122,.05); --shadow-md: 0 16px 38px rgba(31,37,122,.09); --shadow-lg: 0 24px 64px rgba(31,37,122,.12);
  --font-body: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
[data-theme="dark"] {
  --color-bg: #0f133e; --color-surface: #151a53; --color-surface-2: #1a2166; --color-surface-offset: #111648; --color-border: #303985;
  --color-text: #f5f7ff; --color-text-muted: #c4c8e7; --color-text-faint: #959abe; --color-text-inverse: #10143f;
  --color-primary: #f4cb25; --color-primary-hover: #ffd84f; --color-primary-soft: #3b3470; --color-primary-highlight: #423766;
  --color-gold: #f4cb25; --color-gold-soft: #463c16; --color-success: #8fd18a;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.22); --shadow-md: 0 16px 38px rgba(0,0,0,.3); --shadow-lg: 0 24px 64px rgba(0,0,0,.42);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100dvh; font-family: var(--font-body); font-size: var(--text-base); line-height: 1.6;
  color: var(--color-text);
  background:
    radial-gradient(circle at top right, color-mix(in oklab, var(--color-gold) 14%, transparent), transparent 24%),
    radial-gradient(circle at left top, color-mix(in oklab, var(--color-primary) 10%, transparent), transparent 30%),
    linear-gradient(180deg, var(--color-bg), var(--color-surface));
}
img { display:block; max-width:100%; height:auto; }
button, input, textarea { font: inherit; color: inherit; }

.shell { min-height: 100dvh; padding: max(env(safe-area-inset-top), 18px) 16px max(env(safe-area-inset-bottom), 20px); }
.app { width:min(100%, 860px); margin:0 auto; display:grid; gap: 16px; }
.skip-link { position:absolute; left:-999px; top:0; }
.skip-link:focus { left:16px; top:16px; z-index:100; background:var(--color-surface-2); padding:12px 16px; border-radius:12px; }

.panel {
  background: color-mix(in oklab, var(--color-surface) 92%, transparent);
  border:1px solid color-mix(in oklab, var(--color-text) 10%, transparent);
  box-shadow: var(--shadow-md);
  border-radius: 28px;
  backdrop-filter: blur(16px);
}
.topbar { display:flex; align-items:center; justify-content:space-between; gap:12px; padding: 14px 16px; }
.brand { display:flex; align-items:center; gap:12px; min-width:0; }
.brand img { width:62px; height:62px; object-fit:contain; border-radius:16px; background:white; padding:6px; box-shadow: var(--shadow-sm); }
[data-theme="dark"] .brand img { background: #fff; }
.brand-copy { min-width:0; }
.brand-copy strong { display:block; font-size: var(--text-sm); }
.brand-copy span { display:block; font-size: var(--text-xs); color: var(--color-text-muted); }
.top-actions { display:flex; gap:10px; align-items:center; }
.icon-btn, .lang-toggle button {
  min-width:44px; min-height:44px; border:none; border-radius:14px; cursor:pointer;
  background: var(--color-surface-2); color: var(--color-text);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--color-text) 10%, transparent);
}
.lang-toggle { display:flex; gap:8px; padding:4px; border-radius:16px; background: color-mix(in oklab, var(--color-surface-2) 82%, transparent); }
.lang-toggle button { min-width:52px; border-radius:12px; font-size:var(--text-xs); font-weight:700; }
.lang-toggle button.active { background: var(--color-primary); color: var(--color-text-inverse); }
[data-theme="dark"] .lang-toggle button.active { color: #14184a; }

.hero { padding: 22px; overflow:hidden; position:relative; }
.hero::after {
  content:""; position:absolute; inset:auto -40px -40px auto; width:180px; height:180px; border-radius:999px;
  background: radial-gradient(circle, color-mix(in oklab, var(--color-gold) 34%, transparent), transparent 70%);
  pointer-events:none;
}
.eyebrow {
  display:inline-flex; align-items:center; gap:8px; padding:8px 12px; border-radius:999px; font-size:var(--text-xs); font-weight:700; letter-spacing:.04em; text-transform:uppercase;
  color: var(--color-primary); background: color-mix(in oklab, var(--color-primary) 8%, var(--color-surface-2));
}
.error-eyebrow { color: var(--color-error); background: color-mix(in oklab, var(--color-error) 10%, var(--color-surface-2)); }
.success-eyebrow { color: var(--color-success); background: color-mix(in oklab, var(--color-success) 12%, var(--color-surface-2)); }

h1 { font-size: var(--text-xl); line-height:1.08; margin: 16px 0 10px; max-width: 20ch; }
.hero p { margin:0; max-width:52ch; color: var(--color-text-muted); }
.hero-grid { display:grid; gap:12px; margin-top: 20px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.res-card {
  padding: 14px 16px; border-radius: 18px; background: color-mix(in oklab, var(--color-surface-2) 88%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--color-text) 8%, transparent);
}
.res-card label { display:block; font-size:var(--text-xs); color:var(--color-text-muted); margin-bottom:4px; }
.res-card strong { display:block; font-size:var(--text-sm); word-break: break-word; }

/* Booking-channel pill inside the reservation grid */
.channel-strong {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  background: color-mix(in oklab, var(--color-accent, #1f257a) 12%, transparent);
  color: var(--color-text);
  width: fit-content;
  max-width: 100%;
}
.channel-strong[data-channel="airbnb"]       { background:#ffe5ec; color:#a4133c; }
.channel-strong[data-channel="bookingcom"]   { background:#e3edff; color:#1c3faa; }
.channel-strong[data-channel="expedia"]      { background:#fff2d6; color:#7a4a05; }
.channel-strong[data-channel="vrbo"]         { background:#dff6f1; color:#0c5547; }
.channel-strong[data-channel="marriott"]     { background:#f1e7ff; color:#4a1d80; }
.channel-strong[data-channel="affiliate"]    { background:#ffe6da; color:#7a2c00; }
.channel-strong[data-channel="bookingengine"], 
.channel-strong[data-channel="direct"], 
.channel-strong[data-channel="wordpress"]    { background:#e6f4ea; color:#1d5b34; }
.channel-strong[data-theme-dark]              { background: rgba(255,255,255,0.08); color: var(--color-text); }

/* Channel-managed banner inside the right-hand panel */
.channel-banner[hidden] { display:none !important; }
.channel-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0 18px;
  padding: 12px 14px;
  border-radius: 12px;
  background: color-mix(in oklab, #1d5b34 12%, transparent);
  color: var(--color-text);
  font-size: 13.5px;
  line-height: 1.45;
  border: 1px solid color-mix(in oklab, #1d5b34 25%, transparent);
}
.channel-banner svg { flex-shrink: 0; margin-top: 2px; color: #1d5b34; }
.channel-banner strong { font-weight: 700; }

/* Pill inside the channel-managed left panel */
.channel-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--color-accent, #1f257a) 14%, transparent);
  font-weight: 700;
  margin: 0 2px;
}

.split { display:grid; gap:16px; }
.card, .stripe-card { padding: 20px; }
.card h2, .stripe-card h2 { margin:0 0 8px; font-size:var(--text-lg); }
.card p, .stripe-card p { margin:0; color: var(--color-text-muted); }

.steps { margin-top:16px; display:grid; gap:12px; }
.step { display:grid; grid-template-columns: 34px 1fr; gap:12px; align-items:flex-start; }
.step-badge { width:34px; height:34px; border-radius:999px; display:grid; place-items:center; font-size:var(--text-xs); font-weight:700; background: var(--color-gold-soft); color: #7a5a00; }
[data-theme="dark"] .step-badge { color:#fff2b5; }

.secure-chip {
  display:inline-flex; align-items:center; gap:8px; padding:8px 12px; border-radius:999px; background: color-mix(in oklab, var(--color-success) 12%, var(--color-surface)); color: var(--color-success); font-size:var(--text-xs); font-weight:700;
}
.mock-form { margin-top:16px; display:grid; gap:14px; }
#depositPanel[hidden], #channelPanel[hidden] { display:none !important; }
.field { display:grid; gap:6px; }
.field[hidden] { display:none !important; }
.field label { font-size:var(--text-xs); font-weight:700; color:var(--color-text-muted); text-transform: uppercase; letter-spacing: .04em; }
.field-error { color: var(--color-error); font-size: var(--text-xs); min-height: 1em; }
.label-row { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.scan-hint { display:inline-flex; align-items:center; gap:6px; font-size:11px; font-weight:600; color:var(--color-accent, #1f257a); background: rgba(31,37,122,0.07); padding:4px 10px; border-radius:999px; line-height:1.2; text-transform:none; letter-spacing:0; }
.scan-hint svg { flex-shrink:0; }
[data-theme="dark"] .scan-hint { color:#a8b1ff; background: rgba(168,177,255,0.12); }

.real-input, .input {
  min-height:56px; padding:0 16px; border-radius:18px; width:100%;
  background: var(--color-surface-2); color: var(--color-text);
  border: 1px solid color-mix(in oklab, var(--color-text) 10%, transparent);
  outline: none;
  transition: box-shadow var(--transition-interactive), border-color var(--transition-interactive);
}
.real-input:focus, .stripe-input.StripeElement--focus {
  border-color: color-mix(in oklab, var(--color-primary) 38%, transparent);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--color-primary) 10%, transparent);
}
/* Stripe Elements injects a wrapper div containing the iframe. We must NOT use
   flex display on the host because Stripe positions the iframe with absolute
   layout — flex shrinks it to 1px width on iOS. Use block instead and let the
   wrapper take 100% width. */
.stripe-input { display:block; padding: 16px; }
.stripe-input > .__PrivateStripeElement { width: 100% !important; }
.stripe-input.StripeElement--invalid { border-color: var(--color-error); }
.card-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; align-items: start; }
.card-row > .sub-field { margin-top: 0 !important; }
.sub-field + .card-row { margin-top: 10px; }
.sub-field + .sub-field:not(.card-row > .sub-field) { margin-top: 10px; }
.sub-label {
  display: block; font-size: 11px; font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.cvc-hint {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 10px; padding: 10px 12px;
  font-size: var(--text-xs);
  color: #8a5a00;
  background: #fff7df;
  border: 1px solid #f1d271;
  border-radius: 10px;
  line-height: 1.45;
}
[data-theme="dark"] .cvc-hint {
  color: #ffe79a;
  background: rgba(241, 210, 113, 0.12);
  border-color: rgba(241, 210, 113, 0.4);
}
.cvc-hint svg { flex-shrink: 0; }

.pay-error[hidden] { display:none !important; }
.pay-error {
  display: flex; align-items: flex-start; gap: 12px;
  margin: 8px 0 16px; padding: 14px 16px;
  background: #fde8e8;
  border: 1px solid #f3a5a5;
  border-left: 4px solid #c8332a;
  border-radius: 12px;
  color: #6b1a13;
}
[data-theme="dark"] .pay-error {
  background: rgba(200, 51, 42, 0.16);
  border-color: rgba(243, 165, 165, 0.45);
  border-left-color: #ff6b6b;
  color: #ffd9d6;
}
.pay-error-icon { color: #c8332a; flex-shrink: 0; margin-top: 1px; }
[data-theme="dark"] .pay-error-icon { color: #ff6b6b; }
.pay-error-body { flex: 1 1 auto; min-width: 0; }
.pay-error-body strong { display: block; font-size: var(--text-sm); margin-bottom: 4px; }
.pay-error-body p { margin: 4px 0 0; font-size: var(--text-sm); line-height: 1.45; }
.pay-error-body p.small { font-size: var(--text-xs); opacity: 0.85; margin-top: 6px; }

.check-row {
  display:flex; gap:10px; align-items:flex-start; font-size:var(--text-xs); color: var(--color-text-muted); line-height:1.5;
  padding: 12px; border-radius: 14px; background: color-mix(in oklab, var(--color-surface-2) 70%, transparent);
}
.check-row input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--color-primary); }

.signature-wrap {
  position: relative; border-radius: 18px; background: white; border: 1px dashed color-mix(in oklab, var(--color-text) 22%, transparent); overflow: hidden;
}
[data-theme="dark"] .signature-wrap { background: #f5f7ff; }
#signaturePad { width: 100%; height: 160px; display:block; cursor: crosshair; touch-action: none; }
.signature-clear {
  position:absolute; top:8px; right:8px; border:none; cursor:pointer;
  background: var(--color-surface-offset); color: var(--color-text); border-radius: 10px; padding: 6px 10px; font-size: var(--text-xs); font-weight:700;
}

.notice { margin-top:16px; padding:14px 16px; border-radius:18px; background: color-mix(in oklab, var(--color-gold) 16%, var(--color-surface)); color: var(--color-text); }
.notice strong { display:block; margin-bottom:4px; font-size:var(--text-sm); }

.cta, .secondary {
  min-height:56px; width:100%; border:none; border-radius:18px; cursor:pointer; font-weight:700; font-size:var(--text-sm);
  transition: transform var(--transition-interactive), background var(--transition-interactive), color var(--transition-interactive), opacity var(--transition-interactive);
  display:inline-flex; align-items:center; justify-content:center;
}
.cta { background: linear-gradient(135deg, var(--color-primary), color-mix(in oklab, var(--color-primary) 70%, black)); color:white; box-shadow: var(--shadow-lg); text-decoration:none; }
[data-theme="dark"] .cta { color:#15184a; background: linear-gradient(135deg, var(--color-gold), #ffe47f); }
.cta:disabled, .cta.is-disabled { opacity: .45; cursor: not-allowed; filter: grayscale(0.4); box-shadow: none; pointer-events: none; }
.cta:active:not(:disabled), .secondary:active, .icon-btn:active, .lang-toggle button:active { transform: translateY(1px) scale(.995); }
.secondary { background: var(--color-surface-2); color: var(--color-text); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--color-text) 10%, transparent); text-decoration:none; }

.footer-note { text-align:center; padding: 2px 14px 8px; font-size:var(--text-xs); color: var(--color-text-muted); }
.footer-note a { color: var(--color-text-muted); }

.skeleton-grid { display:grid; gap:12px; grid-template-columns: repeat(2, 1fr); margin-top: 20px; }
.skeleton { height: 62px; border-radius: 18px; background: linear-gradient(90deg, color-mix(in oklab, var(--color-text) 5%, transparent), color-mix(in oklab, var(--color-text) 12%, transparent), color-mix(in oklab, var(--color-text) 5%, transparent)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.success-actions { display:grid; gap:12px; margin-top: 20px; }

@media (min-width: 768px) {
  .app { gap:20px; }
  .hero { padding: 28px; }
  .hero-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .split { grid-template-columns: 1.02fr .98fr; }
  .success-actions { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition:none !important; animation: none !important; scroll-behavior:auto !important; } }
