/* ════════════════════════════════════════════════════════════════
 *  order-form.css — Multi-step IPTV order form modal
 *  Loaded by /pricing (and any other page that triggers checkout).
 *  All classes scoped via .ofm-* prefix. Violet/indigo accent palette
 *  intentionally distinct from the device-guides (mint) and
 *  contact-section (amber) modals, so each modal has its own identity.
 * ════════════════════════════════════════════════════════════════ */

/* ─────────────── Modal overlay & dialog ─────────────── */
.ofm-modal {
  position: fixed; inset: 0; z-index: 10002;
  display: none; align-items: center; justify-content: center;
  background: rgba(5, 8, 22, 0.86);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.ofm-modal.open { display: flex; animation: ofm-fade 0.22s ease-out; }
@keyframes ofm-fade { from { opacity: 0 } to { opacity: 1 } }

.ofm-dialog {
  background:
    radial-gradient(ellipse 700px 350px at 90% 0%, rgba(167,139,250,0.10), transparent 60%),
    linear-gradient(180deg, #0e1230 0%, #0a0e1f 100%);
  border: 1px solid rgba(167, 139, 250, 0.30);
  border-radius: 18px;
  max-width: 620px; width: 100%;
  max-height: calc(100vh - 40px);
  overflow: hidden;
  position: relative;
  box-shadow:
    0 36px 80px rgba(0, 0, 0, 0.65),
    0 0 60px rgba(167, 139, 250, 0.10);
  animation: ofm-slide 0.28s cubic-bezier(.2,.8,.2,1);
  color: #e2e8f0;
  display: flex; flex-direction: column;
}
@keyframes ofm-slide {
  from { transform: translateY(14px) scale(0.985); opacity: 0 }
  to   { transform: translateY(0)    scale(1);     opacity: 1 }
}
.ofm-banner {
  height: 4px;
  background: linear-gradient(90deg, transparent, #a78bfa 25%, #c084fc 50%, #a78bfa 75%, transparent);
  flex-shrink: 0;
}

/* ─────────────── Close button ─────────────── */
.ofm-close {
  position: absolute; top: 14px; right: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
  font-size: 1.1rem; cursor: pointer;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  z-index: 3;
}
.ofm-close:hover {
  background: rgba(167, 139, 250, 0.20);
  color: #fff;
  border-color: rgba(167, 139, 250, 0.50);
}

/* ─────────────── Scrollable body ─────────────── */
.ofm-scroll {
  overflow-y: auto;
  padding: 28px 32px 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(167, 139, 250, 0.40) transparent;
  flex: 1 1 auto;
  min-height: 0;
}
.ofm-scroll::-webkit-scrollbar { width: 8px; }
.ofm-scroll::-webkit-scrollbar-thumb {
  background: rgba(167, 139, 250, 0.40); border-radius: 4px;
}

/* ─────────────── Header ─────────────── */
.ofm-head { margin-bottom: 20px; padding-right: 48px; }
.ofm-head h2 {
  margin: 0 0 6px;
  font-size: 1.55rem; font-weight: 800;
  color: #ffffff; letter-spacing: -0.02em; line-height: 1.15;
}
.ofm-head p { margin: 0; font-size: 0.92rem; color: #94a3b8; line-height: 1.5; }
.ofm-head .ofm-accent { color: #c084fc; }

/* ─────────────── Currency switcher (top-right of header area) ─────────────── */
.ofm-currency-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px;
  font-size: 0.82rem; color: #94a3b8;
}
.ofm-currency-row strong { color: #c4b5fd; font-weight: 700; }
.ofm-currency-select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(167, 139, 250, 0.28);
  color: #fff;
  padding: 5px 9px;
  border-radius: 7px;
  font: inherit; font-size: 0.82rem;
  cursor: pointer;
}
.ofm-currency-select:focus { outline: none; border-color: rgba(167, 139, 250, 0.65); }
.ofm-currency-flag { font-size: 1.05em; }

/* ─────────────── Form layout ─────────────── */
.ofm-section { margin-bottom: 22px; }
.ofm-section-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.12em;
  text-transform: uppercase; color: #a78bfa;
  margin: 0 0 12px;
}
.ofm-section-label::before {
  content: ""; width: 18px; height: 1px;
  background: rgba(167, 139, 250, 0.5);
}

.ofm-field { margin-bottom: 14px; }
.ofm-field-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 6px;
}
.ofm-field label {
  font-size: 0.84rem; color: #cbd5e1; font-weight: 600;
}
.ofm-req { color: #c084fc; font-weight: 800; }
.ofm-field-hint { font-size: 0.74rem; color: #64748b; }

.ofm-input, .ofm-select {
  width: 100%;
  padding: 11px 14px;
  background: rgba(15, 23, 42, 0.55);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  font: inherit; font-size: 0.95rem;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.ofm-input::placeholder { color: #64748b; }
.ofm-input:focus, .ofm-select:focus {
  outline: none;
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(167, 139, 250, 0.7);
  box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.16);
}
.ofm-input.ofm-invalid, .ofm-select.ofm-invalid {
  border-color: rgba(239, 68, 68, 0.6);
  background: rgba(239, 68, 68, 0.04);
}
.ofm-error {
  display: none;
  margin-top: 5px;
  font-size: 0.78rem;
  color: #fca5a5;
}
.ofm-error.ofm-show { display: block; }

/* ─────────────── Phone (intl-tel-input overrides for dark theme) ─────────────── */
.iti { width: 100%; }
.iti__country-list {
  background: #0e1230 !important;
  border: 1px solid rgba(167, 139, 250, 0.30) !important;
  color: #e2e8f0 !important;
  box-shadow: 0 18px 40px rgba(0,0,0,0.55) !important;
  border-radius: 10px !important;
  margin-top: 4px;
}
.iti__country.iti__highlight,
.iti__country:hover { background: rgba(167, 139, 250, 0.18) !important; }
.iti__dial-code { color: #94a3b8 !important; }
.iti__divider { border-bottom-color: rgba(255, 255, 255, 0.08) !important; }
.iti__search-input {
  background: rgba(15, 23, 42, 0.55) !important;
  border-bottom: 1px solid rgba(167, 139, 250, 0.25) !important;
  color: #fff !important;
}
.iti__selected-country-primary { background: transparent !important; }
.iti__country-container > button { color: #cbd5e1 !important; }
.iti--inline-dropdown .iti__dropdown-content { background: #0e1230 !important; }

/* ─────────────── Package selector (horizontal cards — same shape as payment cards) ─────────────── */
.ofm-package-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; margin-top: 4px;
}
.ofm-pkg-btn {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 14px;
  background: rgba(15, 23, 42, 0.55);
  border: 1.5px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.08s;
  position: relative;
  font: inherit; color: #e2e8f0; text-align: left;
}
.ofm-pkg-btn:hover {
  border-color: rgba(167, 139, 250, 0.55);
  background: rgba(167, 139, 250, 0.06);
}
.ofm-pkg-btn.ofm-selected {
  border-color: rgba(167, 139, 250, 0.85);
  background: linear-gradient(135deg, rgba(167,139,250,0.15), rgba(124,58,237,0.06));
  box-shadow: 0 0 0 1px rgba(167,139,250,0.40) inset, 0 8px 18px rgba(124,58,237,0.22);
}
.ofm-pkg-btn-num {
  width: 36px; height: 36px; flex-shrink: 0;
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  color: #f5f3ff;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; font-weight: 800;
  box-shadow: 0 4px 12px rgba(167,139,250,0.30);
}
.ofm-pkg-btn-body {
  flex: 1; min-width: 0;
}
.ofm-pkg-btn-name {
  display: block;
  font-weight: 700; color: #fff; font-size: 0.95rem;
  letter-spacing: -0.01em;
}
.ofm-pkg-btn-tagline {
  display: block;
  font-size: 0.76rem; color: #94a3b8; margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ofm-pkg-btn-badge {
  position: absolute; top: -8px; right: 12px;
  background: linear-gradient(135deg, #a78bfa, #c084fc);
  color: #1e1b4b;
  font-size: 0.6rem; font-weight: 800;
  padding: 2px 8px; border-radius: 999px;
  letter-spacing: 0.06em; text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(167,139,250,0.45);
}

/* ─────────────── Duration toggle ─────────────── */
.ofm-duration-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-top: 4px;
}
.ofm-duration-btn {
  position: relative;
  padding: 14px 10px 12px;
  background: rgba(15, 23, 42, 0.55);
  border: 1.5px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  color: #cbd5e1;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.08s;
  text-align: center;
}
.ofm-duration-btn:hover {
  border-color: rgba(167, 139, 250, 0.5);
  background: rgba(167, 139, 250, 0.06);
}
.ofm-duration-btn.ofm-selected {
  border-color: rgba(167, 139, 250, 0.85);
  background: linear-gradient(135deg, rgba(167,139,250,0.15), rgba(124,58,237,0.06));
  box-shadow: 0 0 0 1px rgba(167,139,250,0.40) inset, 0 8px 18px rgba(124,58,237,0.20);
}
.ofm-duration-btn .ofm-dur-months {
  display: block; font-size: 0.95rem; font-weight: 800; color: #fff;
  margin-bottom: 4px; letter-spacing: -0.01em;
}
.ofm-duration-btn .ofm-dur-price {
  display: block; font-size: 0.86rem; color: #c4b5fd; font-weight: 600;
  line-height: 1.3;
}
.ofm-duration-btn .ofm-dur-local { display: block; font-size: 0.72rem; color: #94a3b8; margin-top: 2px; }
.ofm-duration-btn .ofm-dur-badge {
  position: absolute; top: -8px; right: 8px;
  background: linear-gradient(135deg, #a78bfa, #c084fc);
  color: #1e1b4b; font-size: 0.62rem; font-weight: 800;
  padding: 2px 7px; border-radius: 999px;
  letter-spacing: 0.05em; text-transform: uppercase;
  box-shadow: 0 4px 10px rgba(167,139,250,0.45);
}

/* ─────────────── Payment method cards ─────────────── */
.ofm-payment-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; margin-top: 4px;
}
.ofm-pay-card {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 14px;
  background: rgba(15, 23, 42, 0.55);
  border: 1.5px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.08s;
  position: relative;
  font: inherit; color: #e2e8f0; text-align: left;
}
.ofm-pay-card:hover {
  border-color: rgba(167, 139, 250, 0.55);
  background: rgba(167, 139, 250, 0.06);
}
.ofm-pay-card.ofm-selected {
  border-color: rgba(167, 139, 250, 0.85);
  background: linear-gradient(135deg, rgba(167,139,250,0.15), rgba(124,58,237,0.06));
  box-shadow: 0 0 0 1px rgba(167,139,250,0.40) inset, 0 8px 18px rgba(124,58,237,0.20);
}
.ofm-pay-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem;
}
.ofm-pay-icon.paypal { background: linear-gradient(135deg, #003087, #0070ba); color: #fff; }
.ofm-pay-icon.wu     { background: linear-gradient(135deg, #ffdd00, #ffb500); color: #1a1a1a; }
.ofm-pay-icon.taptap { background: linear-gradient(135deg, #0066ff, #00aaff); color: #fff; }
.ofm-pay-icon.crypto { background: linear-gradient(135deg, #f7931a, #ffc857); color: #1a1a1a; }
.ofm-pay-name { font-weight: 700; color: #fff; font-size: 0.95rem; }
.ofm-pay-desc { font-size: 0.76rem; color: #94a3b8; margin-top: 1px; }

/* Crypto sub-options revealed after Crypto card is selected */
.ofm-crypto-sub {
  display: none;
  margin-top: 10px;
  padding: 12px 14px;
  background: rgba(247, 147, 26, 0.06);
  border: 1px dashed rgba(247, 147, 26, 0.30);
  border-radius: 10px;
}
.ofm-crypto-sub.ofm-show { display: block; }
.ofm-crypto-sub label {
  display: block; font-size: 0.78rem; color: #fde68a; margin-bottom: 6px; font-weight: 600;
}
.ofm-crypto-sub-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
}
.ofm-crypto-btn {
  padding: 8px 6px;
  font: inherit; font-size: 0.78rem; font-weight: 600;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  color: #cbd5e1;
  cursor: pointer; text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.ofm-crypto-btn:hover { border-color: rgba(247, 147, 26, 0.55); background: rgba(247,147,26,0.08); color: #fff; }
.ofm-crypto-btn.ofm-selected {
  border-color: rgba(247, 147, 26, 0.85);
  background: rgba(247, 147, 26, 0.15);
  color: #fde68a;
}

/* ─────────────── Other-device conditional input ─────────────── */
.ofm-other-input { display: none; margin-top: 10px; }
.ofm-other-input.ofm-show { display: block; }

/* ─────────────── Sticky price summary + CTA at modal bottom ─────────────── */
.ofm-footer {
  flex-shrink: 0;
  padding: 16px 32px 22px;
  background: linear-gradient(180deg, rgba(14,18,48,0) 0%, rgba(14,18,48,0.95) 25%, #0a0e1f 100%);
  border-top: 1px solid rgba(167, 139, 250, 0.20);
  position: relative;
}
.ofm-summary {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px;
}
.ofm-summary-info { flex: 1 1 auto; min-width: 0; }
.ofm-summary-label { font-size: 0.72rem; color: #94a3b8; letter-spacing: 0.08em; text-transform: uppercase; }
.ofm-summary-line {
  font-size: 0.94rem; color: #cbd5e1; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ofm-summary-line strong { color: #fff; font-weight: 700; }
.ofm-summary-price {
  flex-shrink: 0; text-align: right;
}
.ofm-summary-price .ofm-price-main {
  font-size: 1.45rem; font-weight: 800; color: #fff; letter-spacing: -0.02em;
  display: block; line-height: 1.1;
}
.ofm-summary-price .ofm-price-local {
  display: block; font-size: 0.78rem; color: #c4b5fd; margin-top: 2px; font-weight: 600;
}

.ofm-submit {
  width: 100%;
  padding: 14px 18px;
  background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 50%, #6d28d9 100%);
  color: #f5f3ff;
  border: 0; border-radius: 12px;
  font: inherit; font-weight: 800; font-size: 1rem;
  cursor: pointer;
  transition: filter 0.15s, transform 0.08s, box-shadow 0.15s;
  box-shadow: 0 10px 26px rgba(124,58,237,0.40);
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
}
.ofm-submit:hover { filter: brightness(1.08); box-shadow: 0 14px 30px rgba(124,58,237,0.48); }
.ofm-submit:active { transform: scale(0.99); }
.ofm-submit:disabled { opacity: 0.55; cursor: not-allowed; filter: grayscale(0.4); }

/* Footer-level error banner — appears when user clicks submit with invalid fields */
.ofm-form-error {
  display: none;
  margin: 0 0 12px;
  padding: 11px 14px;
  background: rgba(239, 68, 68, 0.10);
  border: 1px solid rgba(239, 68, 68, 0.40);
  border-radius: 10px;
  color: #fca5a5;
  font-size: 0.88rem;
  line-height: 1.45;
  text-align: left;
}
.ofm-form-error.ofm-show { display: block; animation: ofm-fade 0.18s ease-out; }
.ofm-form-error::before { content: "⚠️ "; margin-right: 4px; }
.ofm-wa-icon {
  width: 22px; height: 22px; flex-shrink: 0;
  background: #25D366;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
}
.ofm-wa-icon svg { width: 13px; height: 13px; fill: #fff; }

/* ─────────────── Loading + success states ─────────────── */
.ofm-loading {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.30);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ofm-spin 0.8s linear infinite;
}
@keyframes ofm-spin { to { transform: rotate(360deg); } }

.ofm-success {
  display: none;
  text-align: center;
  padding: 30px 12px 16px;
  animation: ofm-fade 0.25s ease-out;
}
.ofm-success.ofm-show { display: block; }
.ofm-success-check {
  width: 72px; height: 72px; margin: 0 auto 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 14px 32px rgba(124,58,237,0.45);
  animation: ofm-pop 0.55s cubic-bezier(.34,1.56,.64,1);
}
.ofm-success-check svg { width: 38px; height: 38px; fill: #fff; }
@keyframes ofm-pop {
  0% { transform: scale(0); opacity: 0 }
  60% { transform: scale(1.15); opacity: 1 }
  100% { transform: scale(1); opacity: 1 }
}
.ofm-success h3 { margin: 0 0 8px; color: #fff; font-size: 1.4rem; font-weight: 800; }
.ofm-success p { margin: 0 0 10px; color: #cbd5e1; font-size: 0.93rem; line-height: 1.55; }
.ofm-success .ofm-success-order {
  margin: 14px auto 18px;
  max-width: 380px;
  padding: 14px 16px;
  background: rgba(167,139,250,0.08);
  border: 1px solid rgba(167,139,250,0.30);
  border-radius: 10px;
  font-size: 0.86rem;
  color: #cbd5e1;
  text-align: left;
}
.ofm-success .ofm-success-order strong { color: #fff; }

/* ─────────────── Skeleton / initial loading ─────────────── */
.ofm-form-hidden { display: none; }

/* ─────────────── Responsive ─────────────── */
@media (max-width: 640px) {
  .ofm-modal { padding: 0; align-items: stretch; }
  .ofm-dialog {
    max-width: 100%; max-height: 100vh;
    border-radius: 0; border-left: none; border-right: none;
  }
  .ofm-scroll { padding: 24px 22px 14px; }
  .ofm-footer { padding: 14px 22px 18px; }
  .ofm-head h2 { font-size: 1.28rem; }
  .ofm-payment-grid { grid-template-columns: 1fr; }
  .ofm-package-grid { grid-template-columns: 1fr; }
  .ofm-duration-grid { gap: 8px; }
  .ofm-duration-btn { padding: 12px 8px 10px; }
}

/* ─────────────── Reduced motion ─────────────── */
@media (prefers-reduced-motion: reduce) {
  .ofm-modal.open, .ofm-dialog, .ofm-success-check { animation: none !important; }
  .ofm-duration-btn, .ofm-pay-card, .ofm-crypto-btn { transition: none !important; }
}
