/* ==========================================================================
   Softhika Payment Gateway — Unified Multi-Step Auto-Pay & Manual Styling
   Supports: bKash, Nagad, Rocket, Binance Pay
   ========================================================================== */

.spg-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 18, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s;
}

.spg-backdrop.is-active {
  opacity: 1;
  visibility: visible;
}

.spg-modal {
  position: relative;
  width: 100%;
  max-width: 500px;
  max-height: 94vh;
  overflow-y: auto;
  background: #021245;
  border: 1px solid rgba(157, 76, 204, 0.25);
  border-radius: 20px;
  box-shadow: 0 24px 64px -12px rgba(2, 18, 69, 0.85), 0 0 0 1px rgba(157, 76, 204, 0.15);
  color: #f1f4f9;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
}

[data-theme="light"] .spg-modal {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  color: #0f172a;
  box-shadow: 0 24px 64px -12px rgba(15, 23, 42, 0.22);
}

.spg-backdrop.is-active .spg-modal {
  transform: translateY(0) scale(1);
}

/* Header */
.spg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .spg-header {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

.spg-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.spg-header__shield {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.25), rgba(6, 182, 212, 0.25));
  color: #38bdf8;
}

.spg-header__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}

.spg-header__subtitle {
  display: block;
  font-size: 0.72rem;
  color: #10b981;
  font-weight: 500;
}

.spg-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.65);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  transition: all 0.2s;
}

[data-theme="light"] .spg-close-btn {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.6);
}

.spg-close-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  transform: rotate(90deg);
}

/* Provider Tabs */
.spg-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 12px 20px;
  background: rgba(0, 0, 0, 0.22);
}

[data-theme="light"] .spg-tabs {
  background: rgba(0, 0, 0, 0.03);
}

.spg-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 600;
  transition: all 0.2s;
  text-align: center;
}

[data-theme="light"] .spg-tab {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
  color: #4b5563;
}

.spg-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.spg-tab__icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.72rem;
}

/* Tab Active States */
.spg-tab.is-active[data-method="bkash"] {
  background: rgba(226, 19, 110, 0.18);
  border-color: #E2136E;
  color: #ff338f;
  box-shadow: 0 0 16px rgba(226, 19, 110, 0.25);
}

.spg-tab.is-active[data-method="nagad"] {
  background: rgba(247, 146, 30, 0.18);
  border-color: #F7921E;
  color: #fb923c;
  box-shadow: 0 0 16px rgba(247, 146, 30, 0.25);
}

.spg-tab.is-active[data-method="rocket"] {
  background: rgba(140, 52, 148, 0.2);
  border-color: #8C3494;
  color: #c084fc;
  box-shadow: 0 0 16px rgba(140, 52, 148, 0.25);
}

.spg-tab.is-active[data-method="binance"] {
  background: rgba(240, 185, 11, 0.18);
  border-color: #F0B90B;
  color: #facc15;
  box-shadow: 0 0 16px rgba(240, 185, 11, 0.25);
}

/* Order Summary Bar */
.spg-summary-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.8rem;
}

[data-theme="light"] .spg-summary-bar {
  background: rgba(0, 0, 0, 0.02);
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

.spg-summary-bar__item {
  display: flex;
  flex-direction: column;
}

.spg-summary-bar__label {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

[data-theme="light"] .spg-summary-bar__label {
  color: #64748b;
}

.spg-summary-bar__val {
  font-size: 0.86rem;
  color: #f1f4f9;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-theme="light"] .spg-summary-bar__val {
  color: #0f172a;
}

.spg-summary-bar__item--highlight .spg-summary-bar__val {
  color: #10b981;
  font-size: 0.94rem;
}

/* Step Progress Indicator */
.spg-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px 8px;
  gap: 8px;
}

.spg-step-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.spg-step-dot span {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  font-weight: 700;
  transition: all 0.25s;
}

.spg-step-dot label {
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.45);
}

[data-theme="light"] .spg-step-dot span {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #64748b;
}

[data-theme="light"] .spg-step-dot label {
  color: #94a3b8;
}

.spg-step-dot.is-active span {
  background: #2563eb;
  border-color: #3b82f6;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.5);
}

.spg-step-dot.is-active label {
  color: #38bdf8;
}

.spg-step-line {
  flex: 1;
  max-width: 48px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  margin-bottom: 14px;
  transition: all 0.25s;
}

.spg-step-line.is-active {
  background: #2563eb;
}

/* Body / Views */
.spg-body {
  padding: 16px 22px 20px;
}

.spg-view {
  animation: spgFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes spgFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.spg-view--center {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 8px;
}

/* Brand Banner inside View */
.spg-brand-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid #E2136E;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.02), rgba(226, 19, 110, 0.12));
  margin-bottom: 18px;
}

.spg-brand-banner__logo {
  font-size: 1.15rem;
  font-weight: 800;
  color: #E2136E;
}

.spg-brand-banner__desc {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

[data-theme="light"] .spg-brand-banner__desc {
  color: #475569;
}

/* Fields & Inputs */
.spg-field-group {
  margin-bottom: 16px;
}

.spg-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 8px;
}

[data-theme="light"] .spg-label {
  color: #1e293b;
}

.spg-input-wrapper {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s;
}

[data-theme="light"] .spg-input-wrapper {
  background: #f8fafc;
  border-color: rgba(0, 0, 0, 0.15);
}

.spg-input-wrapper:focus-within {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.spg-input-prefix {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.88rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.75);
}

[data-theme="light"] .spg-input-prefix {
  background: #e2e8f0;
  border-right-color: #cbd5e1;
  color: #334155;
}

.spg-input {
  width: 100%;
  padding: 12px 14px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.96rem;
  font-weight: 600;
  box-sizing: border-box;
}

[data-theme="light"] .spg-input {
  color: #0f172a;
}

.spg-input:focus {
  outline: none;
}

.spg-input--code {
  text-align: center;
  font-size: 1.4rem;
  letter-spacing: 8px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
}

.spg-input--pin {
  text-align: center;
  font-size: 1.5rem;
  letter-spacing: 12px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
}

.spg-hint {
  display: block;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 6px;
  line-height: 1.4;
}

[data-theme="light"] .spg-hint {
  color: #64748b;
}

/* Terms Checkbox */
.spg-terms-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 18px;
}

[data-theme="light"] .spg-terms-check {
  color: #475569;
}

/* Action Buttons */
.spg-btn-action {
  width: 100%;
  padding: 13px;
  font-size: 0.94rem;
  font-weight: 700;
  border-radius: 12px;
  background: linear-gradient(135deg, #9D4CCC 0%, #330065 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(157, 76, 204, 0.35);
}

.spg-btn-action:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(157, 76, 204, 0.55);
}

.spg-btn-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 10px;
}

.spg-btn-ghost {
  padding: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  transition: all 0.2s;
}

.spg-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* OTP Simulation Pill */
.spg-otp-simulation-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-size: 0.8rem;
  color: #10b981;
  margin-bottom: 14px;
}

.spg-chip-btn {
  padding: 3px 8px;
  background: #10b981;
  color: #042f1a;
  border: none;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}

.spg-chip-btn:hover {
  opacity: 0.85;
}

.spg-resend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 16px;
}

.spg-link-btn {
  background: none;
  border: none;
  color: #38bdf8;
  cursor: pointer;
  font-size: 0.78rem;
  padding: 0;
  text-decoration: underline;
}

.spg-security-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 16px;
}

/* Step 4 Processing Animations */
.spg-spinner-box {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 16px auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spg-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(56, 189, 248, 0.2);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: spgSpin 0.8s linear infinite;
}

.spg-pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.15);
  animation: spgPulse 1.6s ease-out infinite;
}

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

@keyframes spgPulse {
  0% { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(1.3); opacity: 0; }
}

.spg-processing-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: #f1f4f9;
}

.spg-processing-desc {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 18px;
  max-width: 320px;
}

.spg-progress-bar {
  width: 240px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin: 0 auto;
}

.spg-progress-fill {
  height: 100%;
  width: 15%;
  background: linear-gradient(90deg, #330065, #9D4CCC);
  transition: width 0.4s ease;
}

/* Step 5 Success Screen */
.spg-success-badge {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.18);
  border: 2px solid #10b981;
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px auto 14px;
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.35);
}

.spg-success-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0 0 4px;
  color: #10b981;
}

.spg-success-sub {
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 16px;
}

.spg-receipt-card {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 18px;
  text-align: left;
}

.spg-receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 0.82rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.spg-receipt-row:last-child {
  border-bottom: none;
}

.spg-receipt-row span {
  color: rgba(255, 255, 255, 0.55);
}

.spg-receipt-row strong {
  color: #f1f4f9;
}

.spg-success-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.spg-btn-wa {
  padding: 11px;
  border-radius: 12px;
  background: rgba(37, 211, 102, 0.15);
  border: 1px solid rgba(37, 211, 102, 0.35);
  color: #25d366;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.spg-btn-wa:hover {
  background: #25d366;
  color: #042410;
}



/* Toast */
.spg-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #0f172a;
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
  z-index: 100000;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.spg-toast.is-shown {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.spg-toast__icon {
  color: #10b981;
}
