* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background: #fff;
  color: #111;
  min-height: 100vh;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 24px 40px;
  min-height: 100vh;
}

/* Retour */
.retour {
  padding: 20px 0 8px;
}
.retour a {
  color: #1a3e7c;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.retour a:hover { text-decoration: underline; }

/* Logo */
.logo-wrap {
  display: flex;
  justify-content: center;
  padding: 24px 0;
}
.logo-wrap img {
  height: 80px;
  object-fit: contain;
}

/* Headings */
h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: #111;
  line-height: 1.2;
  margin-bottom: 8px;
}
.subtitle {
  font-size: 14px;
  color: #666;
  margin-bottom: 24px;
}

/* Form */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #111;
}
.field input {
  width: 100%;
  border: 2px solid #999;
  border-radius: 4px;
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
  transition: border-color .2s;
}
.field input:focus { border-color: #1a3e7c; box-shadow: 0 0 0 3px rgba(26,62,124,.12); }
.field input.error { border-color: #c0392b; }
.field .err-msg {
  font-size: 13px;
  color: #c0392b;
  margin-top: 5px;
  font-weight: 600;
}

/* Links */
.link {
  font-size: 14px;
  color: #111;
  text-decoration: underline;
  display: inline-block;
  margin-bottom: 18px;
  cursor: pointer;
}

/* Checkbox */
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  cursor: pointer;
}
.check-box {
  width: 20px; height: 20px;
  border: 2px solid #888;
  border-radius: 3px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  margin-top: 1px;
  cursor: pointer;
}
.check-box.checked {
  background: #1a3e7c;
  border-color: #1a3e7c;
}
.check-box svg { display: none; }
.check-box.checked svg { display: block; }
.check-label { font-size: 14px; font-weight: 700; color: #111; }

.cookie-text {
  font-size: 13px;
  color: #444;
  line-height: 1.6;
  margin-bottom: 28px;
}
.cookie-text a { color: #444; }

/* Buttons */
.btn-primary {
  width: 100%;
  background: #1a3e7c;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: background .2s;
  display: block;
  text-align: center;
  text-decoration: none;
}
.btn-primary:hover { background: #1248a0; }
.btn-primary:active { background: #0e3d87; }

.btn-ghost {
  width: 100%;
  background: transparent;
  color: #888;
  font-size: 14px;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  margin-top: 10px;
  transition: color .2s, border-color .2s;
}
.btn-ghost:hover { color: #c0392b; border-color: #f5b7b1; }

.btn-link {
  width: 100%;
  background: none;
  border: none;
  color: #1a3e7c;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  margin-top: 12px;
  padding: 8px;
}
.btn-link:hover { text-decoration: underline; }

/* Step 2 keypad */
.dots-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
}
.dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid #ccc;
  background: #fff;
  transition: background .15s, border-color .15s;
}
.dot.filled { background: #1a3e7c; border-color: #1a3e7c; }

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.key {
  aspect-ratio: 1;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  background: #f7f7f7;
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  transition: background .1s, border-color .1s, color .1s;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}
.key:hover { background: #e8f0fb; border-color: #1a3e7c; }
.key:active { background: #1a3e7c; color: #fff; border-color: #1a3e7c; }
.key.blank { border: none; background: transparent; pointer-events: none; }
.key-actions { display: flex; gap: 8px; margin-bottom: 16px; }
.key-actions button {
  flex: 1;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  background: #f7f7f7;
  font-size: 14px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background .15s;
}
.key-actions button:hover { background: #eee; }
.key-actions button:disabled { opacity: 0.4; cursor: not-allowed; }

.info-box {
  background: #ebf2fb;
  border-radius: 10px;
  padding: 12px;
  font-size: 13px;
  color: #1a3e7c;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 20px;
}

/* Success page countdown */
.countdown-card {
  border: 1px solid #e0e0e0;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 20px;
}
.countdown-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.countdown-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #ebf2fb;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.countdown-num {
  margin-left: auto;
  font-size: 28px;
  font-weight: 800;
  color: #1a3e7c;
  font-variant-numeric: tabular-nums;
  min-width: 44px;
  text-align: center;
}
.progress-bar {
  height: 6px;
  background: #eee;
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: #1a3e7c;
  border-radius: 99px;
  transition: width 1s linear;
}

/* SMS OTP inputs */
.otp-row {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 6px;
}
.otp-input {
  flex: 1;
  aspect-ratio: 1;
  border: 2px solid #ccc;
  border-radius: 10px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  outline: none;
  transition: border-color .15s, background .15s;
  color: #1a3e7c;
  background: #fff;
}
.otp-input:focus { border-color: #1a3e7c; box-shadow: 0 0 0 3px rgba(26,62,124,.12); }
.otp-input.filled { background: #f0f4fb; border-color: #1a3e7c; }
.otp-count { text-align: right; font-size: 12px; color: #aaa; margin-bottom: 16px; }
.resend-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  font-size: 14px;
}
.resend-row span { color: #666; }
.resend-timer { color: #aaa; font-variant-numeric: tabular-nums; }
.resend-btn {
  color: #1a3e7c;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  text-decoration: underline;
}

/* Card page */
.card-preview {
  width: 100%;
  height: 200px;
  border-radius: 18px;
  background: linear-gradient(135deg, #1a3e7c 0%, #00a0b0 100%);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin-bottom: 8px;
  cursor: pointer;
  perspective: 1000px;
  position: relative;
}
.card-front, .card-back {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: transform .5s ease;
  background: linear-gradient(135deg, #1a3e7c 0%, #00a0b0 100%);
}
.card-back { transform: rotateY(180deg); }
.card-preview.flipped .card-front { transform: rotateY(180deg); }
.card-preview.flipped .card-back { transform: rotateY(0deg); }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; }
.card-brand-name { color: rgba(255,255,255,.5); font-size: 11px; margin-bottom: 2px; }
.card-brand-sub { color: #fff; font-weight: 700; font-size: 13px; }
.card-chip {
  width: 40px; height: 30px;
  background: rgba(255,220,80,.8);
  border-radius: 4px;
}
.card-number {
  font-family: 'Courier New', monospace;
  font-size: 18px;
  letter-spacing: 3px;
  color: #fff;
  margin-bottom: 8px;
}
.card-bottom { display: flex; justify-content: space-between; align-items: flex-end; }
.card-holder { color: rgba(255,255,255,.8); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.card-exp-label { color: rgba(255,255,255,.5); font-size: 9px; text-align: right; }
.card-exp { color: #fff; font-family: 'Courier New', monospace; font-size: 14px; }
.card-flip-hint { text-align: center; font-size: 12px; color: #aaa; margin-bottom: 20px; }

.card-back-stripe { height: 44px; background: rgba(0,0,0,.4); margin: 0 -24px; margin-top: 0; }
.card-cvv-area { padding: 0; }
.card-cvv-line {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,.2);
  border-radius: 6px;
  padding: 8px 12px;
  margin-top: 16px;
}
.card-cvv-line .line { flex: 1; height: 1px; background: rgba(255,255,255,.3); }
.card-cvv-val { font-family: 'Courier New', monospace; font-weight: 700; font-size: 18px; color: #fff; letter-spacing: 3px; }
.card-cvv-label { text-align: right; color: rgba(255,255,255,.5); font-size: 11px; margin-top: 4px; }

.fields-row { display: flex; gap: 16px; }
.fields-row .field { flex: 1; }
.fields-row .field.narrow { flex: 0 0 110px; }

.secure-note {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f7f7f7;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: #555;
  margin-bottom: 16px;
}

.err-banner {
  background: #fef0ef;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #c0392b;
  font-weight: 600;
  text-align: center;
  margin-bottom: 14px;
}

/* Loader overlay */
.loader-overlay {
  position: fixed; inset: 0;
  background: rgba(255,255,255,.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999;
  gap: 16px;
}
.spinner {
  width: 44px; height: 44px;
  border: 4px solid #e0e0e0;
  border-top-color: #1a3e7c;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text { font-size: 15px; color: #1a3e7c; font-weight: 600; }
