/* ══════════════════════════════════════════════════════════════════
   M-Chaja — Red & Yellow Brand Theme
   Primary red  : #ed2024   (logo background)
   Accent yellow: #FBB921   (logo icon / highlights)
   ══════════════════════════════════════════════════════════════════ */

/* ── Reset ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design tokens ───────────────────────────────────────────────── */
:root {
  --primary:       #ed2024;
  --primary-dk:    #9B0B22;
  --primary-lt:    #f9e5e8;
  --accent:        #FBB921;
  --accent-dk:     #D9970A;
  --accent-lt:     #FFF8E1;
  --success:       #16a34a;
  --danger:        #dc2626;
  --warning:       #d97706;
  --bg:            #f9f2f3;
  --card:          #ffffff;
  --text:          #1a1a1a;
  --muted:         #6b6b6b;
  --border:        #e8d9db;
  --radius:        16px;
  --radius-sm:     10px;
  --shadow:        0 8px 32px rgba(200,16,46,.12);
  --input-h:       52px;
}

/* ── Page ────────────────────────────────────────────────────────── */
html { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  background:
    linear-gradient(rgba(0,0,0,0.0), rgba(0,0,0,0.0)), /* overlay tint */
    url('/assets/pattern.svg') center/cover repeat, /* your image */
    radial-gradient(circle at right center, #ed2024 0%, #7a0016 100%);

  color: var(--text);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

/* ── Card ────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
}

/* ── Card header (red strip with logo) ──────────────────────────── */
.card-header {
  background: linear-gradient(135deg, #ed2024 0%, #a00d24 100%);
  padding: 22px 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 3px solid var(--accent);
}
.card-header img {
  height: 34px;
  width: auto;
  display: block;
}

/* ── Card body ───────────────────────────────────────────────────── */
.card-body {
  padding: 28px 28px 32px;
}

/* ── Page title inside card body ────────────────────────────────── */
.page-title {
  text-align: center;
  margin-bottom: 24px;
}
.page-title .icon {
  font-size: 40px;
  line-height: 1;
  margin-bottom: 8px;
}
.page-title h1 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary);
}
.page-title p {
  font-size: .88rem;
  color: var(--muted);
  margin-top: 4px;
}

/* ── Steps indicator ─────────────────────────────────────────────── */
.steps {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 26px;
}
.step {
  width: 32px; height: 5px;
  border-radius: 3px;
  background: var(--border);
  transition: background .3s;
}
.step.done   { background: var(--success); }
.step.active { background: var(--accent); }

/* ── Form elements ───────────────────────────────────────────────── */
label {
  display: block;
  font-size: .8rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

input[type="text"],
input[type="tel"],
input[type="number"],
input[type="email"] {
  display: block;
  width: 100%;
  height: var(--input-h);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 16px;
  font-size: 1rem;
  color: var(--text);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(200,16,46,.10);
}

.form-group { margin-bottom: 18px; }

/* ── Phone prefix input ──────────────────────────────────────────── */
.input-prefix {
  display: flex;
  align-items: center;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.input-prefix:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(200,16,46,.10);
}
.input-prefix .prefix-flag {
  padding: 0 14px;
  font-size: .95rem;
  color: var(--muted);
  background: var(--primary-lt);
  border-right: 2px solid var(--border);
  height: var(--input-h);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-weight: 600;
}
.input-prefix input {
  border: none;
  box-shadow: none;
  border-radius: 0;
  flex: 1;
}
.input-prefix input:focus { box-shadow: none; }

/* ── OTP digit boxes ─────────────────────────────────────────────── */
.otp-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.otp-inputs input {
  width: 48px;
  height: 58px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  padding: 0;
  letter-spacing: 0;
}
.otp-inputs input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(251,185,33,.25);
}

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: var(--input-h);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: background .2s, transform .1s, box-shadow .2s;
  text-decoration: none;
  letter-spacing: .01em;
}
.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(200,16,46,.35);
}
.btn-primary:hover { background: var(--primary-dk); }

/* Pay button — yellow accent */
.btn-pay {
  background: var(--accent);
  color: #3d2600;
  box-shadow: 0 4px 14px rgba(251,185,33,.4);
}
.btn-pay:hover { background: var(--accent-dk); color: #2a1a00; }

.btn-success {
  background: var(--success);
  color: #fff;
  box-shadow: 0 4px 12px rgba(22,163,74,.3);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-lt); }

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Alerts ──────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.5;
}
.alert-danger  { background: #fef2f2; color: var(--danger);   border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: var(--success);  border: 1px solid #bbf7d0; }
.alert-info    { background: var(--primary-lt); color: var(--primary); border: 1px solid #f5b8c2; }
.alert-warning { background: var(--accent-lt);  color: #854d0e; border: 1px solid #fde68a; }

/* ── Cabinet info card ───────────────────────────────────────────── */
.cabinet-info {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 4px 16px;
  margin-bottom: 20px;
}
.cabinet-info .label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: 2px;
}
.cabinet-info .value {
  font-size: .97rem;
  font-weight: 600;
  color: var(--text);
}
.cabinet-info .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.cabinet-info .row:last-child { border-bottom: none; }

/* ── Price tag ───────────────────────────────────────────────────── */
.price-tag {
  text-align: center;
  background: var(--accent-lt);
  border: 2px solid var(--accent);
  border-radius: 12px;
  padding: 16px;
  margin: 6px 0 20px;
}
.price-tag .currency-label {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent-dk);
}
.price-tag .amount {
  font-size: 2.8rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1.1;
}
.price-tag .currency-code {
  font-size: 1rem;
  font-weight: 700;
  color: var(--muted);
}

/* ── QR scanner ──────────────────────────────────────────────────── */
#qr-reader {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 14px;
  border: 3px solid var(--border);
}
#qr-reader video { border-radius: 10px; }

/* ── Divider ─────────────────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Success / Fail icons ────────────────────────────────────────── */
.result-icon {
  text-align: center;
  margin-bottom: 20px;
}
.result-icon .circle {
  width: 82px; height: 82px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  margin-bottom: 14px;
}
.result-icon .circle.success { background: #dcfce7; }
.result-icon .circle.warning { background: var(--accent-lt); }
.result-icon .circle.danger  { background: #fef2f2; }
.result-icon .circle.unknown { background: var(--bg); }
.result-icon h2 { font-size: 1.4rem; font-weight: 800; color: var(--primary); }
.result-icon p  { color: var(--muted); margin-top: 5px; font-size: .9rem; }

/* Alias for backward-compat */
.success-icon { text-align: center; margin-bottom: 20px; }
.success-icon .circle {
  width: 82px; height: 82px; background: #dcfce7; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 42px; margin-bottom: 14px;
}
.success-icon h2 { font-size: 1.4rem; font-weight: 800; }
.success-icon p  { color: var(--muted); margin-top: 5px; }

.fail-icon { text-align: center; margin-bottom: 20px; }
.fail-icon .circle {
  width: 82px; height: 82px; background: #fef2f2; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 42px; margin-bottom: 14px;
}
.fail-icon h2 { font-size: 1.4rem; font-weight: 800; color: var(--danger); }

/* ── Resend row ──────────────────────────────────────────────────── */
.resend-row {
  text-align: center;
  margin-top: 16px;
  font-size: .88rem;
  color: var(--muted);
}
.resend-row a, .resend-row button {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  background: none;
  border: none;
  cursor: pointer;
  font-size: inherit;
}
.resend-row a:hover, .resend-row button:hover { text-decoration: underline; }

/* ── Spinner ─────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 19px; height: 19px;
  border: 3px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Utility ─────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.mt-4  { margin-top: 16px; }
.mt-2  { margin-top: 8px; }
.mb-0  { margin-bottom: 0; }

small {
  font-size: .8rem;
  color: var(--muted);
  display: block;
  margin-top: 6px;
  line-height: 1.4;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .card-body { padding: 22px 18px 28px; }
  .card-header { padding: 18px; }
}
