/* ──────────────────────────────────────────────────────────────────
 * remvo-modal.css | v1.0
 *
 * Scoped, obsidian + gold theme. Mirrors pay.remvo.app/SelectPage
 * with the rate-per-dollar line intentionally omitted (per the
 * design contract: rate scalar is reserved for the Remvo checkout
 * pages themselves, not surfaced on the partner side).
 *
 * Scoping: every selector is prefixed `.remvo-` to avoid clashing
 * with the host (GE-AS) CSS. Box-sizing is reset inside the modal
 * subtree so we don't inherit weird host defaults.
 *
 * Fonts: Geist Variable for everything except prices, IBM Plex Mono
 * for prices. Loaded from Google Fonts in the Blade partial to keep
 * the host's font pipeline untouched.
 * ────────────────────────────────────────────────────────────────── */

/* ── Tokens (scoped to a single :root-like wrapper) ──────────────── */
.remvo-modal-overlay,
.remvo-modal-overlay * {
  box-sizing: border-box;
}

.remvo-modal-overlay {
  --remvo-obsidian: #1A1A1A;
  --remvo-obsidian-light: #2A2A2A;
  --remvo-gold: #C9A84C;
  --remvo-gold-hover: #B8983F;
  --remvo-white: #FFFFFF;
  --remvo-warm-white: #F5F0EB;
  --remvo-muted: rgba(255, 255, 255, 0.55);
  --remvo-muted-strong: rgba(255, 255, 255, 0.75);
  --remvo-hairline: rgba(255, 255, 255, 0.08);
  --remvo-hairline-strong: rgba(255, 255, 255, 0.16);
  --remvo-error: #E25C5C;

  --remvo-font-sans: 'Geist Variable', 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --remvo-font-mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Code', Menlo, monospace;

  --remvo-radius-sm: 8px;
  --remvo-radius-md: 12px;
  --remvo-radius-lg: 16px;

  --remvo-space-1: 4px;
  --remvo-space-2: 8px;
  --remvo-space-3: 12px;
  --remvo-space-4: 16px;
  --remvo-space-5: 20px;
  --remvo-space-6: 24px;
  --remvo-space-8: 32px;
}

/* ── Overlay ─────────────────────────────────────────────────────── */
.remvo-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(0, 0, 0, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--remvo-space-4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease-out;
  font-family: var(--remvo-font-sans);
  color: var(--remvo-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.remvo-modal-overlay.remvo-is-open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Modal panel ─────────────────────────────────────────────────── */
.remvo-modal {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - var(--remvo-space-8));
  background: var(--remvo-obsidian);
  border: 1px solid var(--remvo-hairline);
  border-radius: var(--remvo-radius-lg);
  padding: var(--remvo-space-6);
  overflow-y: auto;
  transform: translateY(12px);
  transition: transform 200ms ease-out;
}

.remvo-modal-overlay.remvo-is-open .remvo-modal {
  transform: translateY(0);
}

/* ── Header (logomark + close) ───────────────────────────────────── */
.remvo-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--remvo-space-5);
}

.remvo-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.remvo-brand-mark {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.remvo-brand-wordmark {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--remvo-gold);
}

.remvo-modal-close {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--remvo-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--remvo-radius-sm);
  transition: color 150ms ease, background 150ms ease;
}

.remvo-modal-close:hover,
.remvo-modal-close:focus-visible {
  color: var(--remvo-white);
  background: var(--remvo-hairline);
  outline: none;
}

/* ── Title + subtitle ────────────────────────────────────────────── */
.remvo-modal-title {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 var(--remvo-space-2) 0;
  text-align: center;
}

.remvo-modal-subtitle {
  font-size: 14px;
  font-weight: 400;
  color: var(--remvo-muted-strong);
  margin: 0 0 var(--remvo-space-6) 0;
  text-align: center;
}

/* ── Card visual ─────────────────────────────────────────────────── */
.remvo-card {
  position: relative;
  width: 100%;
  max-width: 340px;
  aspect-ratio: 17 / 10;
  margin: 0 auto var(--remvo-space-5) auto;
  background: var(--remvo-obsidian-light);
  border: 1px solid var(--remvo-hairline);
  border-radius: var(--remvo-radius-lg);
  padding: var(--remvo-space-5);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.remvo-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 0.1em;
}

.remvo-card-brand {
  color: var(--remvo-gold);
  font-weight: 600;
}

.remvo-card-label {
  color: var(--remvo-muted);
  font-weight: 400;
  text-transform: uppercase;
}

.remvo-card-amount {
  font-size: 36px;
  font-weight: 600;
  line-height: 1;
  font-feature-settings: 'tnum' 1;
}

/* ── Naira figure (the headline number) ──────────────────────────── */
.remvo-amount-ngn {
  font-family: var(--remvo-font-mono);
  font-size: 28px;
  font-weight: 400;
  text-align: center;
  margin-bottom: var(--remvo-space-5);
  letter-spacing: -0.5px;
  min-height: 34px;          /* keeps layout stable while loading */
}

.remvo-amount-ngn.remvo-is-loading {
  color: var(--remvo-muted);
}

/* ── Denomination grid ───────────────────────────────────────────── */
.remvo-denomination-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--remvo-space-2);
  margin-bottom: var(--remvo-space-5);
}

.remvo-chip {
  appearance: none;
  background: var(--remvo-obsidian-light);
  border: 1px solid var(--remvo-hairline);
  border-radius: var(--remvo-radius-md);
  color: var(--remvo-white);
  font-family: var(--remvo-font-sans);
  font-size: 16px;
  font-weight: 600;
  padding: 14px 0;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.remvo-chip:hover,
.remvo-chip:focus-visible {
  border-color: var(--remvo-hairline-strong);
  outline: none;
}

.remvo-chip.remvo-is-selected {
  border-color: var(--remvo-gold);
  color: var(--remvo-gold);
  background: var(--remvo-obsidian);
}

/* ── Custom amount divider + input ───────────────────────────────── */
.remvo-divider {
  display: flex;
  align-items: center;
  gap: var(--remvo-space-3);
  margin-bottom: var(--remvo-space-3);
}

.remvo-divider::before,
.remvo-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--remvo-hairline);
}

.remvo-divider-text {
  font-size: 12px;
  color: var(--remvo-muted);
}

.remvo-input-wrap {
  position: relative;
  margin-bottom: var(--remvo-space-5);
}

.remvo-input-prefix {
  position: absolute;
  left: var(--remvo-space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--remvo-muted);
  font-size: 16px;
  font-weight: 600;
  pointer-events: none;
}

.remvo-input {
  width: 100%;
  background: var(--remvo-obsidian-light);
  border: 1px solid var(--remvo-hairline);
  border-radius: var(--remvo-radius-md);
  color: var(--remvo-white);
  font-family: var(--remvo-font-sans);
  font-size: 16px;
  font-weight: 600;
  padding: 14px 14px 14px 32px;
  outline: none;
  transition: border-color 150ms ease;
  /* hide native number spinners | reduces visual noise */
  -moz-appearance: textfield;
}

.remvo-input::-webkit-outer-spin-button,
.remvo-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.remvo-input:focus {
  border-color: var(--remvo-gold);
}

.remvo-input.remvo-is-invalid {
  border-color: var(--remvo-error);
}

/* ── CTA + Cancel ────────────────────────────────────────────────── */
.remvo-cta {
  appearance: none;
  width: 100%;
  background: transparent;
  border: 1px solid var(--remvo-gold);
  color: var(--remvo-gold);
  font-family: var(--remvo-font-sans);
  font-size: 15px;
  font-weight: 600;
  padding: 16px;
  border-radius: var(--remvo-radius-md);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
  margin-bottom: var(--remvo-space-2);
}

.remvo-cta:hover:not([disabled]),
.remvo-cta:focus-visible:not([disabled]) {
  background: var(--remvo-gold);
  color: var(--remvo-obsidian);
  outline: none;
}

.remvo-cta[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.remvo-cancel {
  appearance: none;
  width: 100%;
  background: transparent;
  border: 0;
  color: var(--remvo-muted);
  font-family: var(--remvo-font-sans);
  font-size: 14px;
  font-weight: 400;
  padding: 12px;
  cursor: pointer;
  transition: color 150ms ease;
}

.remvo-cancel:hover,
.remvo-cancel:focus-visible {
  color: var(--remvo-white);
  outline: none;
}

/* ── Status messages ─────────────────────────────────────────────── */
.remvo-footnote {
  font-size: 11px;
  color: var(--remvo-muted);
  text-align: center;
  margin-top: var(--remvo-space-4);
}

.remvo-error-msg {
  background: rgba(226, 92, 92, 0.12);
  border: 1px solid rgba(226, 92, 92, 0.3);
  border-radius: var(--remvo-radius-md);
  color: var(--remvo-error);
  font-size: 13px;
  padding: 10px 14px;
  margin-bottom: var(--remvo-space-4);
  display: none;
}

.remvo-error-msg.remvo-is-visible {
  display: block;
}

/* ── Loading state ───────────────────────────────────────────────── */
.remvo-modal.remvo-is-busy {
  pointer-events: none;
}

.remvo-modal.remvo-is-busy::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 26, 0.6);
  border-radius: var(--remvo-radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── The button on GE-AS that opens the modal ────────────────────── */
.remvo-deposit-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--remvo-obsidian, #1A1A1A);
  border: 1px solid var(--remvo-gold, #C9A84C);
  color: var(--remvo-gold, #C9A84C);
  font-family: var(--remvo-font-sans, system-ui), 'Geist Variable', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
  letter-spacing: 0.01em;
}

.remvo-deposit-btn:hover,
.remvo-deposit-btn:focus-visible {
  background: var(--remvo-gold, #C9A84C);
  color: var(--remvo-obsidian, #1A1A1A);
  outline: none;
}

.remvo-deposit-btn .remvo-brand-mark {
  width: 14px;
  height: 14px;
}

/* ── Mobile tweaks ───────────────────────────────────────────────── */
@media (max-width: 480px) {
  .remvo-modal {
    padding: var(--remvo-space-5);
  }
  .remvo-modal-title {
    font-size: 22px;
  }
  .remvo-amount-ngn {
    font-size: 24px;
  }
  .remvo-card-amount {
    font-size: 32px;
  }
}

/* ── Reduced-motion respect ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .remvo-modal-overlay,
  .remvo-modal,
  .remvo-chip,
  .remvo-cta,
  .remvo-modal-close {
    transition: none;
  }
}

/* ─────────────────────────────────────────────────────────────────
   GE-AS conversion-focused additions
   Added after the card was stripped from the modal — see
   patch-strip-card.sh. Keeps the modal compact + adds the new
   rate-per-dollar display.
   ───────────────────────────────────────────────────────────────── */

/* Card block hidden — kept in CSS for safety in case it's rendered
   anywhere else, but display:none locks it out of the modal flow. */
.remvo-card {
    display: none !important;
}

/* New compact rate display — big Naira number, small per-dollar note
   underneath. Replaces the visual weight of the old card. */
.remvo-rate-display {
    text-align: center;
    margin: 0 0 var(--remvo-space-4) 0;
}

.remvo-rate-display .remvo-amount-ngn {
    font-family: var(--remvo-font-mono, 'IBM Plex Mono', monospace);
    font-size: 2rem;
    font-weight: 400;
    color: #f5f5f5;
    line-height: 1.1;
    margin: 0;
    letter-spacing: -.01em;
}

.remvo-rate-display .remvo-rate-note {
    font-family: var(--remvo-font-mono, 'IBM Plex Mono', monospace);
    font-size: .78rem;
    color: rgba(201, 168, 76, 0.7);
    margin: .4rem 0 0 0;
    line-height: 1.2;
    letter-spacing: .02em;
    min-height: 1em;  /* reserves space so layout doesn't jump on rate-load */
}

/* When the rate is still loading, mute the Naira amount slightly */
.remvo-rate-display .remvo-amount-ngn.remvo-is-loading {
    color: rgba(245, 245, 245, 0.38);
    font-size: 1rem;
    font-weight: 400;
}

/* Modal title now reads "Deposit with Naira" — same hierarchy */

/* Tighten modal padding now that the card is gone — feels lighter */
@media (min-width: 480px) {
    .remvo-modal {
        padding: var(--remvo-space-5);
    }
}
