/* ================================================================
   STEM Dorado — Magazine Subscription Page
   ================================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --green: #16a34a;
  --green-light: #dcfce7;
  --amber: #d97706;
  --amber-light: #fef3c7;
  --red: #dc2626;
  --red-light: #fee2e2;
  --gray-50:  #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-900: #111827;
  --font-body: 'Inter', sans-serif;
  --font-heading: 'Space Grotesk', sans-serif;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);
}

body { font-family: var(--font-body); color: var(--gray-900); background: var(--gray-50); }

.container { max-width: 860px; margin: 0 auto; padding: 0 24px; }

/* ===== HERO ===== */
.sub-hero {
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  color: #fff;
  padding: 40px 0 56px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255,255,255,.7);
  margin-bottom: 28px;
}

.breadcrumb a { color: rgba(255,255,255,.7); text-decoration: none; }
.breadcrumb a:hover { color: #fff; }
.breadcrumb i { font-size: 10px; }

.sub-hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.sub-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}

.sub-hero-text h1 {
  font-family: var(--font-heading);
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.15;
}

.sub-hero-text > p {
  font-size: 15px;
  color: rgba(255,255,255,.85);
  max-width: 520px;
  line-height: 1.6;
  margin-bottom: 24px;
}

.sub-pricing-pills {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.price-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: var(--radius);
  padding: 10px 16px;
}

.price-pill i { font-size: 18px; color: rgba(255,255,255,.8); }
.price-pill > div { display: flex; flex-direction: column; }
.price-amount { font-family: var(--font-heading); font-size: 22px; font-weight: 700; color: #fff; line-height: 1; }
.price-label { font-size: 12px; color: rgba(255,255,255,.75); margin-top: 2px; }

.sub-mag-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  border: 2px solid rgba(255,255,255,.25);
  color: #fff;
  gap: 4px;
  flex-shrink: 0;
}

.sub-mag-badge i { font-size: 28px; }
.sub-mag-badge span { font-family: var(--font-heading); font-size: 18px; font-weight: 700; }
.sub-mag-badge small { font-size: 11px; color: rgba(255,255,255,.75); text-align: center; }

/* ===== FORM SECTION ===== */
.sub-form-section {
  padding: 40px 0 80px;
}

.sub-form-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  padding: 40px;
  box-shadow: var(--shadow-md);
}

/* ===== SECTION TITLES ===== */
.form-section-title {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.form-step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

.form-section-title h2 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 3px;
}

.form-section-title p {
  font-size: 14px;
  color: var(--gray-600);
}

.form-divider {
  border: none;
  border-top: 1px solid var(--gray-100);
  margin: 32px 0;
}

/* ===== DELIVERY TOGGLE ===== */
.delivery-toggle {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.delivery-option { cursor: pointer; display: block; }
.delivery-option input[type="radio"] { display: none; }

.delivery-option-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  transition: border-color .15s, background .15s;
}

.delivery-option input:checked + .delivery-option-inner {
  border-color: var(--primary);
  background: #eff6ff;
}

.delivery-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: var(--gray-600);
  flex-shrink: 0;
  transition: background .15s, color .15s;
}

.delivery-option input:checked + .delivery-option-inner .delivery-icon {
  background: var(--primary);
  color: #fff;
}

.delivery-text { flex: 1; }
.delivery-text strong { display: block; font-size: 15px; color: var(--gray-900); }
.delivery-text span { font-size: 13px; color: var(--gray-600); }

.delivery-price {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.digital-price { color: var(--green); }
.price-pill.digital { border-color: rgba(255,255,255,.3); }

/* ===== CONDITIONAL BLOCKS ===== */
.conditional-block {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 4px;
}

/* ===== FORM GROUPS ===== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
}

.req { color: var(--red); }
.opt { font-weight: 400; color: var(--gray-400); font-size: 12px; }

.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--gray-900);
  outline: none;
  transition: border-color .2s;
  background: #fff;
}

.form-group input:focus,
.form-group select:focus { border-color: var(--primary); }

.form-group input.error,
.form-group select.error { border-color: var(--red); }

.form-error {
  font-size: 12px;
  color: var(--red);
  min-height: 16px;
}

.select-wrapper { position: relative; }
.select-wrapper select { width: 100%; appearance: none; padding-right: 36px; }
.select-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 12px;
  pointer-events: none;
}

/* ===== GRIDS ===== */
.details-grid,
.address-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.span-2 { grid-column: 1 / -1; }

/* ===== ORDER SUMMARY ===== */
.order-summary {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.order-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--gray-700);
  padding: 6px 0;
}

.order-total {
  border-top: 1px solid var(--gray-200);
  margin-top: 8px;
  padding-top: 12px;
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
}

.order-total span:last-child {
  font-family: var(--font-heading);
  font-size: 20px;
  color: var(--primary);
}

.order-note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--gray-400);
  display: flex;
  gap: 6px;
  align-items: flex-start;
  line-height: 1.5;
}

/* ===== CHECKBOX ===== */
.form-check { margin-bottom: 24px; }

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--gray-700);
  line-height: 1.5;
}

.checkbox-label input[type="checkbox"] { display: none; }

.checkbox-custom {
  width: 18px;
  height: 18px;
  border: 2px solid var(--gray-200);
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}

.checkbox-label input:checked + .checkbox-custom {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox-label input:checked + .checkbox-custom::after {
  content: '';
  display: block;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
}

.checkbox-label a { color: var(--primary); font-weight: 500; }

/* ===== ACTIONS ===== */
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  text-decoration: none;
  padding: 10px 0;
  transition: color .15s;
}

.btn-back:hover { color: var(--gray-900); }

.btn-submit {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background .15s, opacity .15s;
}

.btn-submit:hover:not(:disabled) { background: var(--primary-dark); }
.btn-submit:disabled { opacity: .45; cursor: not-allowed; }

/* ===== SUCCESS STATE ===== */
.sub-success {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  padding: 56px 40px;
  box-shadow: var(--shadow-md);
  text-align: center;
  max-width: 620px;
  margin: 0 auto;
}

.success-icon {
  font-size: 56px;
  color: var(--amber);
  margin-bottom: 20px;
}

.sub-success h2 {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 10px;
}

.sub-success > p {
  font-size: 15px;
  color: var(--gray-600);
  line-height: 1.6;
  margin-bottom: 24px;
}

.success-ref-box {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--amber-light);
  border: 1.5px solid #fde68a;
  border-radius: var(--radius);
  padding: 12px 28px;
  margin-bottom: 28px;
}

.success-ref-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #92400e;
}

.success-ref-number {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: #78350f;
  letter-spacing: 1px;
}

.success-items {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
  margin-bottom: 32px;
}

.success-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.success-item i {
  font-size: 18px;
  color: var(--primary);
  margin-top: 2px;
  flex-shrink: 0;
}

.success-item strong { display: block; font-size: 14px; color: var(--gray-900); margin-bottom: 2px; }
.success-item span { font-size: 13px; color: var(--gray-600); line-height: 1.5; }

.success-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.btn-primary-lg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s;
}

.btn-primary-lg:hover { background: var(--primary-dark); }

.btn-outline-lg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: 2px solid var(--gray-200);
  color: var(--gray-700);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color .15s, color .15s;
}

.btn-outline-lg:hover { border-color: var(--primary); color: var(--primary); }

.success-contact { font-size: 13px; color: var(--gray-400); }
.success-contact a { color: var(--primary); font-weight: 500; }

/* ===== RESPONSIVE ===== */
@media (max-width: 760px) {
  .delivery-toggle { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .sub-form-card { padding: 24px 18px; }
  .details-grid, .address-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: 1; }
  .sub-hero-inner { flex-direction: column; }
  .sub-mag-badge { display: none; }
  .form-actions { flex-direction: column-reverse; align-items: stretch; }
  .btn-submit { justify-content: center; }
  .sub-success { padding: 36px 20px; }
}
