/* Component Styles — Apple HIG Controls, Grouped Cards & Segmented Pickers */

/* Elevated Content Surface (materials.md › Standard materials) */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--brand-surface);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-icon-badge svg {
  width: 19px;
  height: 19px;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.card-subtitle {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 0.12rem;
}

/* Form Groups & Inputs (text-fields.md, entering-data.md) */
.form-grid {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.input-row-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 600px) {
  .input-row-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  position: relative;
}

.form-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.label-required {
  color: var(--brand-accent-text, #065F46);
  font-weight: 700;
  margin-left: 0.15rem;
}

.label-hint {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-dim);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 48px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast), box-shadow 0.24s var(--spring-bounce), transform 0.24s var(--spring-bounce);
}

.input-wrapper:hover {
  border-color: rgba(5, 223, 114, 0.45);
}

.input-wrapper:focus-within {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 4px var(--brand-accent-glow), 0 2px 12px rgba(5, 223, 114, 0.16);
  transform: translateY(-1.5px);
}

.input-wrapper.has-error {
  border-color: var(--border-error);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18);
  transform: translateY(0);
}

.input-wrapper.is-valid {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(5, 223, 114, 0.2);
}

.input-icon-leading {
  padding-left: 0.9rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  pointer-events: none;
}

.input-icon-leading svg {
  width: 18px;
  height: 18px;
}

.form-input {
  width: 100%;
  padding: 0.78rem 0.9rem;
  font-size: 1rem;
  /* 16px prevents iOS zoom and matches HIG mobile body readability */
  font-weight: 500;
  color: var(--text-main);
  background: transparent;
  border: none;
  outline: none;
}

.form-input::placeholder {
  color: #8A9991;
  font-weight: 400;
}

.input-icon-trailing {
  padding-right: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.validation-status-icon {
  width: 18px;
  height: 18px;
  display: none;
}

.input-wrapper.is-valid .validation-status-icon.success {
  display: block;
  color: var(--status-success);
}

.input-wrapper.has-error .validation-status-icon.error {
  display: block;
  color: var(--status-error);
}

.input-error-msg {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--status-error);
  display: none;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.15rem;
}

.input-error-msg.visible {
  display: flex;
}

/* Custom Country Picker */
.country-picker-dropdown {
  position: relative;
  width: 100%;
}

.country-selected-btn {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.72rem 0.9rem;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--text-main);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.country-selected-btn:hover {
  border-color: rgba(17, 28, 22, 0.28);
}

.country-selected-btn:focus,
.country-selected-btn.open {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-glow);
}

.country-btn-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.flag-emoji {
  font-size: 1.2rem;
  line-height: 1;
}

.country-code-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.18rem 0.45rem;
  background: var(--bg-grouped-inset);
  border-radius: 6px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.country-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-floating);
  z-index: 50;
  max-height: 290px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: slideDown 0.18s ease-out;
}

.country-dropdown-menu.show {
  display: flex;
}

.country-search-box {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-grouped-inset);
}

.country-search-input {
  width: 100%;
  padding: 0.5rem 0.7rem;
  font-size: 0.88rem;
  background: #FFFFFF;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  outline: none;
}

.country-search-input:focus {
  border-color: var(--brand-primary);
}

.country-options-list {
  overflow-y: auto;
  max-height: 230px;
  list-style: none;
}

.country-option-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.9rem;
  font-size: 0.9rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(17, 28, 22, 0.04);
  transition: background var(--transition-fast);
}

.country-option-item:hover,
.country-option-item.highlighted {
  background: var(--bg-grouped-inset);
}

.country-option-item.active {
  background: var(--brand-surface);
  font-weight: 600;
  color: var(--brand-primary);
}

/* Phone Input with Carrier Auto-Detection */
.phone-dial-code {
  display: inline-flex;
  align-items: center;
  padding: 0 0.65rem 0 0.9rem;
  height: 26px;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.95rem;
  border-right: 1px solid var(--border-color);
  user-select: none;
  font-variant-numeric: tabular-nums;
}

.carrier-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  animation: fadeIn 0.2s ease-out;
}

.carrier-pill.mtn {
  background: var(--color-mtn);
  color: var(--color-mtn-text);
}

.carrier-pill.airtel {
  background: var(--color-airtel);
  color: var(--color-airtel-text);
}

.carrier-pill.zamtel {
  background: var(--color-zamtel);
  color: var(--color-zamtel-text);
}

.carrier-pill.unknown {
  background: var(--bg-grouped-inset);
  color: var(--text-dim);
}

/* Apple Segmented Control for Participant Count (segmented-controls.md) */
.participant-count-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.count-chips-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  background: rgba(118, 118, 128, 0.12);
  padding: 4px;
  border-radius: 12px;
  max-width: 100%;
  overflow: hidden;
}

@media (max-width: 480px) {
  .count-chips-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 3px;
    gap: 3px;
  }
}

.count-chip-btn {
  min-height: 38px;
  min-width: 0;
  padding: 0.4rem 0.15rem;
  background: transparent;
  border: none;
  border-radius: 9px;
  color: var(--text-muted);
  font-size: clamp(0.72rem, 2.2vw, 0.84rem);
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: transform 0.26s var(--spring-bounce), color 0.18s ease, background 0.2s ease, box-shadow 0.26s var(--spring-bounce);
  will-change: transform;
}

.count-chip-btn:hover {
  color: var(--text-main);
  transform: translateY(-1.5px) scale(1.04);
}

.count-chip-btn:active {
  transform: scale(0.92, 0.88);
  /* Playful stretchy squish */
  transition: transform 0.08s ease;
}

.count-chip-btn.active {
  background: #FFFFFF;
  color: var(--brand-primary);
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12), 0 0 0 1.5px var(--brand-accent), 0 2px 6px var(--brand-accent-glow);
  transform: scale(1.02);
  animation: springChipPop 0.38s var(--spring-bounce);
}

@keyframes springChipPop {
  0% {
    transform: scale(0.92);
  }

  60% {
    transform: scale(1.07);
  }

  100% {
    transform: scale(1.02);
  }
}

.custom-count-container {
  display: none;
  animation: springCountSlide 0.35s var(--spring-bounce);
  margin-top: 0.4rem;
}

@keyframes springCountSlide {
  0% {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.custom-count-container.show {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.multiplication-math-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(5, 223, 114, 0.12) 0%, rgba(11, 59, 36, 0.06) 100%);
  border: 1px solid rgba(5, 223, 114, 0.32);
  box-shadow: 0 2px 10px rgba(5, 223, 114, 0.12);
  padding: 0.65rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--brand-primary);
  font-variant-numeric: tabular-nums;
  animation: springPop 0.35s var(--spring-bounce);
  transition: transform 0.25s var(--spring-bounce);
}

.multiplication-math-pill:hover {
  transform: translateY(-1px) scale(1.01);
}

.multiplication-math-pill .math-highlight {
  font-weight: 800;
  font-size: 0.95rem;
  color: #047857;
  letter-spacing: -0.01em;
}

/* Apple-Style Payment Method Choice Cards (3-column equal on desktop, stacked on mobile) */
.payment-methods-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

@media (min-width: 640px) {
  .payment-methods-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.method-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  background: #FFFFFF;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform 0.28s var(--spring-bounce), border-color 0.2s ease, box-shadow 0.28s var(--spring-bounce), background 0.2s ease;
  position: relative;
  will-change: transform;
}

@media (min-width: 640px) {
  .method-card {
    flex-direction: column;
    gap: 0.65rem;
    padding: 1.1rem;
  }
}

.method-card:hover {
  border-color: rgba(5, 223, 114, 0.45);
  background: #FCFDFD;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06), 0 0 12px var(--brand-accent-glow-subtle);
}

.method-card:active {
  transform: scale(0.95, 0.92);
  /* Playful stretchy press */
  transition: transform 0.08s ease;
}

.method-card.active {
  border-color: var(--brand-accent);
  background: #F4FBF7;
  box-shadow: 0 0 0 2px var(--brand-accent), 0 8px 22px var(--brand-accent-glow);
  transform: translateY(-2px);
  animation: springCardPop 0.38s var(--spring-bounce);
}

@keyframes springCardPop {
  0% {
    transform: scale(0.94);
  }

  60% {
    transform: scale(1.04);
  }

  100% {
    transform: translateY(-2px) scale(1);
  }
}

.method-radio {
  accent-color: var(--brand-accent);
  width: 17px;
  height: 17px;
  margin-top: 2px;
}

@media (min-width: 640px) {
  .method-radio {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    margin-top: 0;
  }
}

.method-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-grouped-inset);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.26s var(--spring-bounce);
}

.method-card.active .method-icon-wrap {
  background: var(--brand-accent-gradient);
  color: #042E1C;
  transform: scale(1.08);
  box-shadow: 0 4px 12px var(--brand-accent-glow);
}

.method-icon-wrap svg {
  width: 18px;
  height: 18px;
}

.method-details {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.method-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.method-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Bank Transfer & Card Sub-panels (Inset Grouped Style) */
.bank-transfer-box,
.card-payment-box {
  background: var(--bg-grouped-inset);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  animation: fadeIn 0.25s ease-out;
}

.bank-box-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.bank-details-list {
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.bank-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.9rem;
  font-size: 0.83rem;
  border-bottom: 1px solid rgba(17, 28, 22, 0.06);
}

.bank-detail-row:last-child {
  border-bottom: none;
}

.bank-detail-label {
  color: var(--text-muted);
  font-weight: 500;
}

.bank-detail-val {
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.copy-badge-btn {
  background: var(--bg-grouped-inset);
  border: 1px solid var(--border-strong);
  padding: 0.25rem 0.6rem;
  min-height: 28px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.copy-badge-btn:hover {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #FFFFFF;
}

.card-brands-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-logos {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.card-logo-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 5px;
  background: #FFFFFF;
  border: 1px solid var(--border-strong);
  color: var(--text-main);
}

/* Order Summary Pass (Apple Store Checkout Style) */
.summary-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.65rem;
  box-shadow: var(--shadow-sm);
}

.summary-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1.15rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  letter-spacing: -0.02em;
}

.summary-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.35rem;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.summary-row.total {
  padding-top: 1rem;
  border-top: 1px solid var(--border-strong);
  margin-top: 0.35rem;
}

.summary-row.total .total-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.summary-row.total .total-value {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-main);
  font-family: var(--font-heading);
  letter-spacing: -0.025em;
}

.fee-waived-badge {
  font-size: 0.74rem;
  font-weight: 800;
  color: #047857;
  background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
  border: 1px solid rgba(5, 223, 114, 0.4);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  box-shadow: 0 1px 4px rgba(5, 223, 114, 0.15);
}

/* Primary Action Button (buttons.md › Style & Role with Spring Physics) */
.btn-pay-primary {
  width: 100%;
  min-height: 52px;
  padding: 0.95rem 1.45rem;
  background: linear-gradient(135deg, #0B3B24 0%, #0F452C 100%);
  color: #FFFFFF;
  border: 1px solid rgba(5, 223, 114, 0.3);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  box-shadow: 0 4px 14px rgba(11, 59, 36, 0.25), 0 0 12px var(--brand-accent-glow-subtle);
  transition: transform 0.32s var(--spring-bounce), box-shadow 0.32s var(--spring-bounce), border-color 0.2s ease, background 0.2s ease;
  position: relative;
  overflow: hidden;
  will-change: transform;
}

.btn-pay-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(5, 223, 114, 0.22), transparent);
  transition: left 0.75s ease;
}

.btn-pay-primary:hover:not(:disabled)::before {
  left: 100%;
}

.btn-pay-primary:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 28px rgba(11, 59, 36, 0.32), 0 0 20px var(--brand-accent-glow);
  border-color: var(--brand-accent);
}

.btn-pay-primary:active:not(:disabled) {
  transform: scale(0.95, 0.92);
  /* Playful stretchy squish */
  transition: transform 0.08s ease;
  box-shadow: 0 2px 6px rgba(11, 59, 36, 0.2);
}

.btn-pay-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  width: 100%;
  min-height: 48px;
  padding: 0.8rem 1.25rem;
  background: var(--bg-card);
  color: var(--text-main);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: transform 0.28s var(--spring-bounce), border-color 0.2s ease, box-shadow 0.28s var(--spring-bounce), background 0.2s ease;
}

.btn-secondary:hover {
  background: var(--bg-card-subtle);
  border-color: rgba(5, 223, 114, 0.45);
  transform: translateY(-2px) scale(1.015);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:active {
  transform: scale(0.96, 0.93);
  transition: transform 0.08s ease;
}

.copy-badge-btn {
  background: var(--bg-grouped-inset);
  border: 1px solid var(--border-strong);
  padding: 0.28rem 0.65rem;
  min-height: 28px;
  border-radius: 7px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: transform 0.24s var(--spring-bounce), background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  will-change: transform;
}

.copy-badge-btn:hover {
  background: var(--brand-accent);
  border-color: var(--brand-accent);
  color: #042E1C;
  transform: translateY(-2px) scale(1.08);
  box-shadow: 0 3px 8px var(--brand-accent-glow);
}

.copy-badge-btn:active {
  transform: scale(0.90);
  transition: transform 0.08s ease;
}

.btn-pay-primary svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #FFFFFF;
  border-radius: var(--radius-full);
  animation: spin 0.75s linear infinite;
  display: none;
}

.btn-pay-primary.loading .btn-text,
.btn-pay-primary.loading .btn-icon {
  display: none;
}

.btn-pay-primary.loading .btn-spinner {
  display: block;
}

/* Concise Trust Footnote List */
.trust-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 1.25rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border-color);
}

.trust-check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.79rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.trust-check-item svg {
  width: 15px;
  height: 15px;
  color: var(--brand-accent-text, #065F46);
  flex-shrink: 0;
  margin-top: 2px;
}

/* Mobile Card Compact Padding */
@media (max-width: 480px) {

  .card,
  .summary-card {
    padding: 1.2rem 1rem;
    border-radius: 16px;
  }

  .card-header {
    margin-bottom: 1.1rem;
    padding-bottom: 0.75rem;
  }

  .count-chip-btn {
    font-size: 0.78rem;
    padding: 0.4rem 0.2rem;
  }
}