/* Modern Mobile-Friendly 5-Step Checkout Interface - Hebrew RTL Fintech Design */

:root {
  --bg-dark: #f4f6f9;               /* Clean Slate Background */
  --bg-card: #ffffff;               /* Pure White Card */
  --bg-card-solid: #ffffff;
  --bg-input: #ffffff;              /* Crisp White Input */
  --bg-input-focus: #ffffff;
  
  --border-card: #e2e8f0;
  --border-input: #cbd5e1;
  --border-focus: #0d6efd;          /* Primary Blue Focus */
  
  --primary-green: #0d6efd;         /* Primary Blue */
  --primary-green-hover: #0b5ed7;   /* Darker Blue Hover */
  --primary-green-glow: rgba(13, 110, 253, 0.25);
  --primary-green-light: #ecf5ff;
  
  --status-red: #e11d48;
  --status-red-light: #fff1f2;
  --status-amber: #d97706;
  --status-amber-light: #fffbeb;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  --font-family: 'Rubik', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Inter', monospace;
  
  --radius-sm: 8px;                 /* 8px Rounded Corners */
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.08);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
  overflow-x: hidden !important;
  max-width: 100vw;
  width: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  position: relative;
  overflow-x: hidden !important;
  max-width: 100vw;
  width: 100%;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

/* Image & SVG Boundary Protection */
img, svg {
  max-width: 100%;
  height: auto;
}

/* Background Soft Ambient Orbs */
.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}
.glow-1 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(13, 110, 253, 0.1) 0%, rgba(244, 246, 249, 0) 70%);
  top: -100px;
  left: 10%;
}
.glow-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.1) 0%, rgba(244, 246, 249, 0) 70%);
  bottom: -150px;
  right: 10%;
}

/* HTML5 Canvas Confetti */
.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 999;
}

.app-wrapper {
  width: 100%;
  max-width: 640px;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Header Styles & Top Session Timer Banner */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

/* Israel Flag Background Banner Ambient Touch */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 180px;
  background: url('https://www.btl.gov.il/PublishingImages/flag-banner-bg.png') no-repeat top center / cover;
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}

.main-brand-logo {
  height: 42px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.08));
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-weight: 700;
  font-size: clamp(1rem, 3.5vw, 1.15rem);
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.brand-subtitle {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--primary-green);
}

/* Header Badges: 40-Min Session Timer Banner, Security Status & Ticket ID */
.header-center-info {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-inline-start: auto; /* Pushes badges far away from the logo */
}

.security-status-badge, .session-timer-badge, .ticket-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  font-size: 0.60rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  line-height: 1;
  opacity: 0.85;
}

.security-status-badge {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
}

.session-timer-badge, .ticket-badge {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: var(--text-dim);
}

.session-timer-badge svg, .ticket-badge svg {
  width: 12px;
  height: 12px;
}

.status-pulse-dot {
  width: 5px;
  height: 5px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
  animation: pulse-dot 1.8s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.timer-countdown {
  color: var(--primary-green);
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.icon-btn:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

/* Main Checkout Flow Card (#ffffff pure white card) */
.flow-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

/* 5-Step Wizard Navigation Header (Clean Segmented Line Connectors) */
.stepper-nav {
  margin-bottom: 28px;
  padding: 4px 6px;
}

.stepper-track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  width: 100%;
}

.step-connector {
  flex: 1;
  height: 3px;
  background: #e2e8f0;
  margin: 0 6px;
  position: relative;
  border-radius: 9999px;
  overflow: hidden;
}

.connector-fill {
  height: 100%;
  width: 0%;
  background: #0d6efd;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

html[dir="rtl"] .connector-fill {
  margin-right: 0;
  margin-left: auto;
}

.step-connector.completed .connector-fill {
  width: 100%;
}

button.step-node {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #64748b;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  outline: none;
  font-family: var(--font-mono);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Completed Step: Soft solid blue fill with white checkmark */
button.step-node.completed {
  background: #0d6efd;
  border-color: #0d6efd;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(13, 110, 253, 0.25);
}

/* Active Step: Solid blue background with glowing ring & micro scale */
button.step-node.active {
  background: #0d6efd;
  border-color: #0d6efd;
  color: #ffffff;
  transform: scale(1.08);
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.22);
}

.node-number {
  line-height: 1;
}

.step-header-info {
  margin-bottom: 24px;
}

.step-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--primary-green);
  text-transform: uppercase;
  margin-bottom: 6px;
  background: var(--primary-green-light);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--primary-green-glow);
}

.step-title {
  font-size: clamp(1.2rem, 4vw, 1.45rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 6px;
}

.step-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Form Steps Layout Engine */
.step-view {
  display: none;
  animation: fadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.margin-top-md { margin-top: 16px; }
.margin-top-lg { margin-top: 24px; }

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 4px;
}

.required-star {
  color: var(--status-red);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

/* Clean 48px rounded input fields with min 44px touch height */
.form-input {
  width: 100%;
  height: 48px;
  min-height: 44px;
  padding: 0 16px;
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 16px !important; /* Prevents iOS Safari auto-zoom on focus */
  transition: var(--transition-fast);
  outline: none;
  -webkit-appearance: none;
}

/* Numeric & Monospace Input Direction Fix (Ensures professional LTR number typing in RTL) */
.font-mono,
input[type="tel"],
input[type="number"],
input[inputmode="numeric"],
#phoneNumber,
#paymentRef,
#expiresOn,
#verificationDigits,
#confirmationNumber {
  direction: ltr !important;
  text-align: left;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  unicode-bidi: isolate;
}

html[dir="rtl"] .input-wrapper .form-input.font-mono,
html[dir="rtl"] .input-wrapper input[type="tel"] {
  padding-inline-start: 16px;
  padding-inline-end: 44px;
}

.form-input::placeholder {
  color: #94a3b8;
}

.form-input:focus {
  background-color: #ffffff;
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

.input-icon {
  position: absolute;
  inline-end: 14px;
  color: var(--text-dim);
  pointer-events: none;
  transition: var(--transition-fast);
}

.form-input:focus + .input-icon {
  color: #0d6efd;
}

.form-input.invalid {
  border-color: var(--status-red) !important;
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.15) !important;
}

.field-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.error-msg {
  font-size: 0.78rem;
  color: var(--status-red);
  min-height: 18px;
  font-weight: 500;
}

.text-center { text-align: center; }

/* Step 3 Card Styling */
.visa-3ds-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-top: 3.5px solid #0d6efd;
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.visa-3ds-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 18px;
}

.visa-logo-badge {
  display: flex;
  align-items: center;
  gap: 6px;
}

.visa-text {
  font-family: 'Rubik', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--primary-green);
}

.visa-secure-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--primary-green);
  background: var(--primary-green-light);
  border: 1px solid var(--primary-green);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.08em;
}

.bank-issuer-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 20px;
}

/* 3DS Summary Table (Strict Hebrew RTL Layout) */
.visa-summary-table {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 0.85rem;
  direction: rtl !important;
  text-align: right !important;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  direction: rtl !important;
}

.summary-row:not(:last-child) {
  border-bottom: 1px dashed #e2e8f0;
}

.summary-key {
  color: var(--text-dim);
  text-align: right !important;
}

.summary-val {
  color: var(--text-main);
  font-weight: 600;
}

/* 3DS Prompt Banner */
.visa-auth-prompt {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--primary-green-light);
  border: 1px solid #93c5fd;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
}

.prompt-icon {
  color: var(--primary-green);
  display: flex;
}

.prompt-text {
  font-size: 0.825rem;
  color: #1e3a8a;
}

.confirm-input-container {
  display: flex;
  justify-content: center;
  margin: 14px 0;
}

/* Segmented 6-Digit Passcode OTP Boxes (Apple/Bank Responsive Mobile Style) */
.otp-boxes-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 2.2vw, 10px);
  direction: ltr !important;
  width: 100%;
}

.otp-digit-box {
  width: clamp(34px, 11vw, 44px);
  height: clamp(44px, 13vw, 52px);
  min-height: 44px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  font-size: clamp(1.2rem, 4.5vw, 1.5rem);
  font-weight: 700;
  color: var(--text-main);
  text-align: center !important;
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  -webkit-appearance: none;
}

.otp-digit-box:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 3.5px rgba(13, 110, 253, 0.18);
  transform: translateY(-2px);
}

.otp-digit-box.filled {
  border-color: #0d6efd;
  background-color: #f8fafc;
}

.otp-digit-box.invalid {
  border-color: var(--status-red) !important;
  background-color: #fff1f2 !important;
  box-shadow: 0 0 0 3.5px rgba(225, 29, 72, 0.18) !important;
}

.visa-footer-cert {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* Step 4 Loading Screen (Fintech Gate Style) */
.loading-card {
  text-align: center;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pulse-spinner-container {
  position: relative;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.spinner-ring {
  position: absolute;
  inset: 0;
  border: 3px solid #e2e8f0;
  border-top-color: var(--primary-green);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.payment-lock-icon {
  color: var(--primary-green);
}

.loading-main-title {
  font-size: clamp(1.15rem, 4vw, 1.35rem);
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.loading-sub-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.loading-progress-wrapper {
  width: 100%;
  max-width: 320px;
  height: 8px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 10px;
}

.loading-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0d6efd 0%, #38bdf8 100%);
  border-radius: var(--radius-full);
  transition: width 0.4s ease-out;
}

.loading-percent {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-green);
  margin-bottom: 20px;
}

.loading-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.status-indicator-dot {
  width: 8px;
  height: 8px;
  background: #0d6efd;
  border-radius: 50%;
  animation: blink 1.2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Step 5 Result States & Printable Receipt Box */
.result-state-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.result-state-card.hidden {
  display: none;
}

.result-icon-glow {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.green-glow {
  background: #ecfdf5;
  color: #10b981;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.25);
}

.red-glow {
  background: var(--status-red-light);
  color: var(--status-red);
  box-shadow: 0 0 20px rgba(225, 29, 72, 0.25);
}

.amber-glow {
  background: var(--status-amber-light);
  color: var(--status-amber);
  box-shadow: 0 0 20px rgba(217, 119, 6, 0.25);
}

.result-status-title {
  font-size: clamp(1.25rem, 4vw, 1.45rem);
  font-weight: 700;
  margin-bottom: 6px;
}

.green-text { color: #10b981; }
.red-text { color: var(--status-red); }
.amber-text { color: var(--status-amber); }

.result-status-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Receipt Card Layout */
.receipt-box {
  width: 100%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: right;
  margin-bottom: 16px;
}

.receipt-watermark-stamp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 4px 10px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #047857;
  letter-spacing: 0.06em;
}

.warning-box {
  border-color: #fecdd3;
  background: #fff1f2;
}

.amber-border-box {
  border-color: #fef08a;
  background: #fffbeb;
}

.receipt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.receipt-brand {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
}

.receipt-ticket-pill {
  background: #e2e8f0;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 0.85rem;
}

.receipt-row:not(:last-child) {
  border-bottom: 1px dashed #e2e8f0;
}

.receipt-label {
  color: var(--text-dim);
}

.receipt-val {
  font-weight: 600;
  color: var(--text-main);
}

/* Global Loading Overlay Backdrop */
.global-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.global-loading-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.overlay-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  text-align: center;
  max-width: 360px;
  width: 90%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.95);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.global-loading-overlay.active .overlay-card {
  transform: scale(1);
}

.overlay-btl-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
  margin-bottom: 14px;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.1));
}

.overlay-icon-box {
  width: 64px;
  height: 64px;
  background: #ecf5ff;
  border: 1px solid var(--primary-green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-green);
  margin-bottom: 20px;
  animation: pulse-border 1.5s ease-in-out infinite;
}

@keyframes pulse-border {
  0%, 100% { box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(13, 110, 253, 0); }
}

.overlay-main-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.overlay-sub-text {
  font-size: 0.825rem;
  color: var(--text-muted);
}

/* Generic Action Button System with Min 44x44 Touch Target */
.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-actions.center {
  justify-content: center;
}

.form-actions.space-between {
  justify-content: space-between;
}

.btn {
  height: 48px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition-fast);
  border: none;
  outline: none;
  text-decoration: none;
  touch-action: manipulation;
}

.btn-primary {
  background: #0d6efd;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(13, 110, 253, 0.25);
}

.btn-primary:hover:not(:disabled) {
  background: #0b5ed7;
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.35);
}

.btn-secondary {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--text-muted);
}

.btn-secondary:hover:not(:disabled) {
  background: #f8fafc;
  color: var(--text-main);
  border-color: #94a3b8;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

html[dir="rtl"] .btn-arrow {
  transform: rotate(180deg);
}

html[dir="rtl"] .btn-arrow-back {
  transform: rotate(180deg);
}

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #0f172a;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: 0.825rem;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Footer Trust Badges Strip */
.app-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.trust-badge-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 16px;
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  color: var(--text-dim);
  box-shadow: var(--shadow-sm);
}

.trust-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.trust-dot {
  color: #cbd5e1;
}

/* Footer Legal Links & Academic Disclaimer Button Styles */
.footer-legal-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
  font-size: 0.75rem;
}

.legal-link-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-family);
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: underline;
  cursor: pointer;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  transition: var(--transition-fast);
}

.legal-link-btn:hover {
  color: var(--primary-green);
}

.legal-dot {
  color: #cbd5e1;
}

/* Academic Disclaimer & Legal Modal Dialog */
.legal-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.legal-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.legal-modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  transform: translateY(16px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.legal-modal-backdrop.active .legal-modal-card {
  transform: translateY(0);
}

.legal-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.legal-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.legal-title-group h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.legal-close-icon {
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--text-dim);
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.legal-close-icon:hover {
  color: var(--text-main);
}

.legal-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.academic-alert-box {
  display: flex;
  gap: 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: #b45309;
}

.academic-alert-box strong {
  display: block;
  font-size: 0.9rem;
  color: #92400e;
  margin-bottom: 4px;
}

.academic-alert-box p {
  font-size: 0.825rem;
  margin: 0;
  color: #b45309;
}

.legal-section h4 {
  font-size: 0.925rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.legal-section p {
  margin: 0;
}

.legal-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  justify-content: flex-end;
}

/* ==========================================================================
   Responsive Media Queries (Mobile Platform First UX Engine)
   ========================================================================== */

@media (max-width: 640px) {
  html, body {
    padding: 12px 10px max(16px, env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden !important;
    touch-action: pan-y !important; /* Disables accidental horizontal swipe scrolling */
  }

  .bg-glow {
    display: none !important; /* Eliminates 120px GPU blur repaints during mobile keyboard typing */
  }

  .app-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
    gap: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .flow-card {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
    padding: 20px 14px 20px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
  }

  .stepper-nav {
    margin-bottom: 20px;
    padding: 0;
  }

  .step-connector {
    margin: 0 3px;
    height: 2.5px;
  }

  button.step-node {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    font-size: 0.75rem;
  }

  .form-grid-2 {
    grid-template-columns: 1fr !important;
  }

  .visa-3ds-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .summary-row, .receipt-row, .receipt-header {
    flex-wrap: wrap;
    gap: 6px;
  }

  .header-center-info {
    display: none;
  }

  .trust-badge-strip {
    font-size: 0.65rem;
    gap: 6px;
    padding: 8px;
    flex-direction: column;
  }

  .trust-dot {
    display: none;
  }

  /* Mobile Sticky Bottom Action Bar with iPhone Safe Area inset */
  .form-actions {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    padding: 12px 14px max(12px, env(safe-area-inset-bottom));
    margin-inline: -14px;
    margin-bottom: -20px;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
    z-index: 99;
  }

  .btn {
    height: 48px;
    min-height: 44px;
    font-size: 0.95rem;
    width: 100%;
  }

  .global-loading-overlay, .legal-modal-backdrop {
    backdrop-filter: none !important;
    background: rgba(15, 23, 42, 0.88) !important;
  }
}

/* ==========================================================================
   Print Engine Stylesheet (Strict 1-Page Printable Receipt Box)
   ========================================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 10mm;
  }

  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: auto !important;
    height: auto !important;
    width: 100% !important;
    overflow: visible !important;
  }

  .bg-glow,
  .confetti-canvas,
  .global-loading-overlay,
  .stepper-nav,
  .app-header,
  .app-footer,
  .toast-container,
  .legal-modal-backdrop,
  .form-actions,
  .step-header-info,
  .result-icon-glow,
  .result-status-title,
  .result-status-desc {
    display: none !important;
  }

  .app-wrapper {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
  }

  .flow-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .receipt-box {
    border: 1.5px solid #000000 !important;
    background: #ffffff !important;
    color: #000000 !important;
    padding: 20px !important;
    margin: 0 !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .receipt-header {
    border-bottom: 1.5px solid #000000 !important;
  }

  .receipt-row {
    border-bottom: 1px dashed #cccccc !important;
  }
}
