/* Mirrors common_lib/lib/core/utils/color_constants.dart (BimaColors) and
   the kFontBody/kFontDisplay tokens, so this page reads as the same product
   as the Flutter app despite having none of its code. */
:root {
  --navy: #0A2261;
  --navy-hover: #082365;
  --blue: #325CA8;
  --sky: #97CCE7;
  --ink: #18181C;
  --mist: #F4F5F7;
  --text-primary: #18181C;
  --text-secondary: #404655;
  --text-muted: #5E6B7B;
  --text-disabled: #9AA3AE;
  --surface-page: #F4F5F7;
  --surface-card: #FFFFFF;
  --surface-input: #FFFFFF;
  --border-default: #E4E9F0;
  --border-strong: #CBD5E0;
  --border-error: #EF4444;
  --error-bg: #FEF2F2;
  --error-text: #B91C1C;
  --success: #1BB792;
  --success-bg: #E6FAF6;
  --success-text: #0F7A5A;
  --overlay-bg: rgba(10, 24, 46, 0.55);
  --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Quicksand', var(--font-body);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--surface-page);
  font-family: var(--font-body);
  color: var(--text-primary);
}

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

.hidden { display: none !important; }

.state-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 60vh;
  gap: 8px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-default);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.state-panel h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  margin: 4px 0;
}

.state-panel p { color: var(--text-muted); margin: 0; font-size: 14px; }

.success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 8px;
}

.card {
  background: var(--surface-card);
  border-radius: 16px;
  padding: 24px 20px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}

.title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--navy);
  margin: 0 0 2px;
}

.subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 20px;
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.req { color: var(--border-error); }

.field input,
.field select {
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-default);
  background: var(--surface-input);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease;
}

.field input:focus,
.field select:focus {
  border-color: var(--sky);
}

.field.has-error input,
.field.has-error select {
  border-color: var(--border-error);
}

.field-error {
  display: none;
  font-size: 12px;
  color: var(--error-text);
  margin: 6px 0 0;
}

.field.has-error .field-error { display: block; }

.plan-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--sky);
  background: #F5FAFD;
}

.plan-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 5px solid var(--navy);
  background: #fff;
  flex-shrink: 0;
}

.plan-name { display: block; font-weight: 700; font-size: 14px; }
.plan-premium { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.benefit-box {
  background: var(--mist);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 16px 0 24px;
}

.benefit-title { font-weight: 700; font-size: 13px; margin: 0 0 10px; }

.benefit-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  padding: 4px 0;
}

.benefit-row dt { color: var(--text-muted); margin: 0; }
.benefit-row dd { margin: 0; font-weight: 600; text-align: right; }

.btn-primary {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: var(--navy);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.btn-primary:hover { background: var(--navy-hover); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.banner {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
}

.banner-error {
  background: var(--error-bg);
  color: var(--error-text);
}

.overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

@media (min-width: 480px) {
  .overlay { align-items: center; }
}

.dialog {
  background: #fff;
  border-radius: 16px;
  padding: 24px 20px;
  width: 100%;
  max-width: 400px;
}

.dialog h2 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--ink);
}

.dialog-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 16px;
}

.dialog-offer {
  font-size: 14px;
  font-weight: 600;
  margin: 8px 0 16px;
}

.agree-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  margin-bottom: 20px;
}

.agree-row input { margin-top: 2px; }
.agree-row a { color: var(--blue); font-weight: 600; }

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
}

.btn-text {
  background: none;
  border: none;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
}

.btn-text-primary { color: var(--navy); }
.btn-text:disabled { opacity: 0.4; cursor: not-allowed; }

.otp-boxes {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 8px 0 12px;
}

.otp-box {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  border-radius: 10px;
  border: 1px solid var(--border-default);
  outline: none;
}

.otp-box:focus { border-color: var(--sky); }

#otp-error {
  text-align: center;
  display: none;
}

#otp-error.visible { display: block; }
