/* ─── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-primary: #0B1120;
  --bg-secondary: #111827;
  --bg-card: #1A2332;
  --bg-input: #0F1A2A;
  --border: #1E3A5F;
  --border-focus: #0EA5E9;
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --accent: #10B981;
  --accent-hover: #059669;
  --accent-glow: rgba(16, 185, 129, 0.15);
  --danger: #EF4444;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
  --transition: cubic-bezier(0.23, 1, 0.32, 1);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ─── Page Layout ─────────────────────────────────────────────── */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Header ──────────────────────────────────────────────────── */
.checkout-header {
  border-bottom: 1px solid var(--border);
  background: rgba(11, 17, 32, 0.9);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  height: 36px;
  width: auto;
}

.header-secure {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

/* ─── Main Content ────────────────────────────────────────────── */
.checkout-main {
  flex: 1;
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

/* ─── Order Accordion ─────────────────────────────────────────── */
.order-section {
  margin-bottom: 28px;
}

.order-accordion {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.accordion-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s var(--transition);
}

.accordion-toggle:hover {
  background: rgba(255, 255, 255, 0.02);
}

.accordion-toggle-left {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
}

.accordion-toggle-left span {
  color: var(--text-muted);
}

.accordion-arrow {
  transition: transform 0.3s var(--transition);
}

.accordion-toggle[aria-expanded="true"] .accordion-arrow {
  transform: rotate(180deg);
}

.accordion-total {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-muted);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--transition), padding 0.35s var(--transition);
  padding: 0 20px;
}

.accordion-content.open {
  max-height: 400px;
  padding: 0 20px 20px;
}

/* ─── Order Items ─────────────────────────────────────────────── */
.order-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.order-item:last-child {
  border-bottom: none;
}

.item-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.item-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.main-icon {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(14, 165, 233, 0.15));
  color: var(--accent);
}

.addon-icon {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-secondary);
}

.item-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.item-desc {
  font-size: 11px;
  color: var(--text-muted);
}

.item-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.item-price {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.remove-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--transition);
  opacity: 0.6;
}

.remove-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  opacity: 1;
  transform: scale(1.05);
}

.order-item.removed {
  opacity: 0;
  max-height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
  transition: all 0.3s var(--transition);
}

.order-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

.order-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
}

.total-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.total-amount {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-muted);
}

/* ─── Payment Form ────────────────────────────────────────────── */
.payment-section {
  margin-bottom: 28px;
}

.form-block {
  background: var(--bg-card);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow), 0 0 12px rgba(16, 185, 129, 0.08);
}

.form-block-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Card Logos */
.card-logos {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.card-logo {
  width: 60px;
  height: 40px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  transition: all 0.2s var(--transition);
  opacity: 0.7;
  background: #fff;
}

.card-logo.active {
  border-color: var(--border);
  opacity: 1;
  background: #fff;
  box-shadow: none;
}

.card-logo img,
.card-logo svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Form Fields */
.form-field {
  margin-bottom: 14px;
}

.form-field:last-child {
  margin-bottom: 0;
}

.form-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-field input,
.form-field select {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  transition: all 0.2s var(--transition);
  outline: none;
}

.form-field input::placeholder {
  color: var(--text-muted);
}

.form-field input:focus,
.form-field select:focus {
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15), 0 0 12px rgba(255, 255, 255, 0.1);
}

/* Sequential field illumination - highlights the next field to fill */
.form-field.illuminate input,
.form-field.illuminate select {
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1), 0 0 8px rgba(255, 255, 255, 0.08);
}

.form-field.illuminate label {
  color: var(--text-primary);
}

.form-field input.error,
.form-field select.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.input-with-icon {
  position: relative;
}

.field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.input-with-icon input {
  padding-left: 42px;
}

.field-icon-right {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* ─── Submit Button ───────────────────────────────────────────── */
.submit-btn {
  width: 100%;
  padding: 16px 24px;
  background: #10B981;
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s var(--transition);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
  margin-top: 20px;
}

.submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(16, 185, 129, 0.4);
}

.submit-btn:active {
  transform: scale(0.98);
}

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

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.form-disclaimer {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 14px;
  line-height: 1.6;
}

.form-disclaimer a {
  color: var(--text-secondary);
  text-decoration: underline;
}

/* ─── Trust Badges ────────────────────────────────────────────── */
.trust-section {
  text-align: center;
  padding: 24px 0;
}

.trust-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.trust-badge svg {
  color: var(--accent);
  flex-shrink: 0;
}

.security-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  opacity: 0.7;
}

.security-logo {
  height: 28px;
  width: auto;
  filter: grayscale(1) brightness(0.7);
}

.mcafee-badge,
.norton-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mcafee-badge span {
  color: #22c55e;
  line-height: 1.2;
}

.norton-badge span {
  color: #eab308;
  line-height: 1.2;
}

/* ─── Footer ──────────────────────────────────────────────────── */
.checkout-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.footer-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--text-secondary);
}

/* ─── Responsive ──────────────────────────────────────────────── */
@media (max-width: 600px) {
  .checkout-main {
    padding: 20px 16px 40px;
  }

  .form-block {
    padding: 18px;
  }

  .form-row {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .trust-badges {
    gap: 12px;
  }

  .trust-badge {
    font-size: 10px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .header-logo {
    height: 28px;
  }

  .total-amount {
    font-size: 18px;
  }
}

/* ─── Error Messages ──────────────────────────────────────────── */
.field-error {
  font-size: 11px;
  color: var(--danger);
  margin-top: 4px;
  display: none;
}

.field-error.visible {
  display: block;
}

/* ─── Success State ───────────────────────────────────────────── */
.success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 17, 32, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--transition);
}

.success-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.success-content {
  text-align: center;
  padding: 40px;
}

.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: var(--accent);
}

.success-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.success-text {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Addon disclosure text */
.addon-disclosure {
  color: #6b7280;
  font-size: 0.8rem;
  text-align: center;
  margin: 0 0 0.75rem 0;
  padding: 0;
  letter-spacing: 0.01em;
}
