/**
 * KÖP IPTV SVERIGE — DEDIKERAD SÄKER KASSA (CHECKOUT SIDA)
 * Matchar exakt designskissen för "Säker Kassa"
 * Responsiv, friktionsfri och optimerad för maximal konvertering
 */

.checkout-page-section {
  padding: 36px 0 70px;
  min-height: calc(100vh - 70px);
}

.checkout-page-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 32px;
}

.checkout-secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(13, 148, 136, 0.1);
  border: 1px solid rgba(13, 148, 136, 0.28);
  color: #0f766e;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  margin-bottom: 14px;
}

.checkout-page-title {
  font-size: clamp(2rem, 5vw, 2.7rem);
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 8px;
}

.checkout-page-subtitle {
  font-size: clamp(0.92rem, 2.5vw, 1.05rem);
  color: #475569;
  line-height: 1.5;
  max-width: 620px;
  margin: 0 auto;
}

/* Huvudlayout: Formulär & Sidebar */
.checkout-grid-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 28px;
  align-items: start;
  max-width: 1080px;
  margin: 0 auto;
}

/* Stegkort */
.checkout-step-card {
  background: #ffffff;
  border: 1.5px solid rgba(226, 232, 240, 0.95);
  border-radius: var(--radius-xl);
  padding: 24px 26px;
  margin-bottom: 20px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
  transition: all var(--transition-base);
}

.checkout-step-card:hover {
  border-color: rgba(13, 148, 136, 0.35);
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.06);
}

.step-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.step-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.step-badge-num {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  color: #ffffff;
  font-weight: 900;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.28);
}

.step-title-text {
  font-size: 1.12rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
  margin: 0;
}

.step-badge-tag {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
}

/* Enhetsväljare (Mörk kapselmeny) */
.checkout-devices-wrap {
  margin-bottom: 20px;
}

.devices-wrap-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 10px;
}

.checkout-devices-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: #090e17;
  padding: 6px;
  border-radius: 14px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.35);
}

.device-select-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  background: transparent;
  color: #94a3b8;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-transform: uppercase;
}

.device-select-pill .pill-tv-icon {
  font-size: 1rem;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.device-select-pill:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.device-select-pill.active {
  background: #ffffff;
  color: #0f172a;
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), 0 0 12px rgba(13, 148, 136, 0.2);
}

.device-select-pill.active .pill-tv-icon {
  opacity: 1;
  transform: scale(1.1);
}

/* Planurvalskort (Vertikal lista) */
.checkout-plans-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkout-plan-card {
  position: relative;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.checkout-plan-card:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  transform: translateY(-1px);
}

.checkout-plan-card.active {
  border: 2px solid #0d9488;
  background: #f0fdfa;
  box-shadow: 0 4px 18px rgba(13, 148, 136, 0.12);
}

.plan-card-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.plan-radio-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  background: #ffffff;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.checkout-plan-card.active .plan-radio-circle {
  border-color: #0d9488;
  background: #ffffff;
}

.plan-radio-circle::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0d9488;
  opacity: 0;
  transform: scale(0.4);
  transition: all 0.2s ease;
}

.checkout-plan-card.active .plan-radio-circle::after {
  opacity: 1;
  transform: scale(1);
}

.plan-info-texts {
  min-width: 0;
}

.plan-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.plan-title-bold {
  font-size: 1.02rem;
  font-weight: 800;
  color: #0f172a;
}

.plan-badge-pill {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.plan-badge-pill.save-badge {
  background: rgba(13, 148, 136, 0.12);
  color: #0f766e;
  border: 1px solid rgba(13, 148, 136, 0.22);
}

.plan-badge-pill.best-value {
  background: #0d9488;
  color: #ffffff;
}

.plan-billing-note {
  font-size: 0.78rem;
  color: #64748b;
  margin: 0;
}

.plan-card-right {
  text-align: right;
  flex-shrink: 0;
}

.plan-price-main-line {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 6px;
}

.plan-main-kr {
  font-size: 1.25rem;
  font-weight: 900;
  color: #0f172a;
}

.plan-old-kr {
  font-size: 0.8rem;
  color: #94a3b8;
  text-decoration: line-through;
  font-weight: 600;
}

.plan-rate-per-month {
  font-size: 0.76rem;
  font-weight: 700;
  color: #0d9488;
  margin-top: 1px;
}

/* Steg 2 & 3: Formulärfält */
.form-field-group {
  margin-bottom: 16px;
}

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

.form-field-label {
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 6px;
}

.form-field-label .req-star {
  color: #ea580c;
  font-weight: 800;
}

.form-field-input,
.form-field-select {
  width: 100%;
  padding: 12px 14px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  color: #0f172a;
  font-family: inherit;
  transition: all var(--transition-fast);
  box-sizing: border-box;
}

.form-field-input:focus,
.form-field-select:focus {
  outline: none;
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
  background: #ffffff;
}

.form-field-input.input-error,
.form-field-select.input-error {
  border-color: #ef4444;
  background: #fef2f2;
}

.form-field-help {
  font-size: 0.76rem;
  color: #64748b;
  margin-top: 4px;
  line-height: 1.35;
}

.form-field-error-msg {
  display: none;
  font-size: 0.76rem;
  color: #dc2626;
  font-weight: 700;
  margin-top: 4px;
}

.form-two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Högerkolumn: Ordersammanfattning */
.checkout-summary-col {
  position: relative;
}

.checkout-summary-card {
  background: #ffffff;
  border: 1.5px solid rgba(226, 232, 240, 0.95);
  border-radius: var(--radius-xl);
  padding: 24px 22px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
  position: sticky;
  top: 90px;
}

.summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
  gap: 8px;
}

.summary-title {
  font-size: 1.08rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.summary-badge-live {
  background: rgba(13, 148, 136, 0.12);
  color: #0f766e;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.summary-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.summary-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  font-size: 0.85rem;
  gap: 12px;
}

.summary-row-label {
  color: #64748b;
  font-weight: 500;
}

.summary-row-val {
  color: #0f172a;
  font-weight: 700;
  text-align: right;
  word-break: break-word;
}

/* Rabattkod fält i sammanfattning */
.summary-promo-wrap {
  margin: 16px 0;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.summary-promo-wrap.applied {
  background: #f0fdfa;
  border-color: #0d9488;
  border-style: solid;
}

.promo-quick-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.promo-label-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
}

.btn-quick-promo {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(13, 148, 136, 0.12);
  border: 1px solid rgba(13, 148, 136, 0.35);
  color: #0f766e;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-quick-promo:hover {
  background: #0d9488;
  color: #ffffff;
  border-color: #0d9488;
}

.btn-quick-promo.applied {
  background: #0d9488;
  color: #ffffff;
  border-color: #0d9488;
  pointer-events: none;
}

.promo-custom-row {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.promo-input-compact {
  flex: 1;
  padding: 6px 10px;
  font-size: 0.82rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-weight: 600;
  text-transform: uppercase;
}

.promo-btn-compact {
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  background: #0f172a;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.promo-status-msg {
  font-size: 0.74rem;
  margin-top: 6px;
  font-weight: 600;
  display: none;
}

.promo-status-msg.success {
  display: block;
  color: #047857;
}

.promo-status-msg.error {
  display: block;
  color: #b91c1c;
}

.summary-divider {
  height: 1px;
  background: rgba(226, 232, 240, 0.85);
  margin: 16px 0;
}

.summary-total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 2px;
}

.summary-total-label {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
}

.summary-total-price {
  font-size: 1.7rem;
  font-weight: 900;
  color: #0d9488;
}

.summary-savings-note {
  font-size: 0.76rem;
  font-weight: 700;
  color: #0f766e;
  text-align: right;
  margin-bottom: 16px;
}

.summary-security-box {
  background: #f8fafc;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.76rem;
  color: #0369a1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
}

/* Stor CTA-knapp i botten */
.checkout-cta-wrap {
  margin-top: 26px;
  text-align: center;
}

.btn-complete-order {
  width: 100%;
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  color: #ffffff;
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  padding: 18px 28px;
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 26px rgba(13, 148, 136, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  box-sizing: border-box;
}

.btn-complete-order:hover {
  background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
  box-shadow: 0 12px 32px rgba(13, 148, 136, 0.48);
  transform: translateY(-2px);
}

.btn-complete-order:active {
  transform: translateY(0);
}

.checkout-cta-subtext {
  font-size: 0.84rem;
  color: #64748b;
  margin-top: 10px;
  margin-bottom: 12px;
}

.checkout-guarantee-bullets {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 0.8rem;
  color: #0f766e;
  font-weight: 700;
  flex-wrap: wrap;
}

/* Bekräftelsemodal */
.checkout-redirect-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.checkout-redirect-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.checkout-redirect-modal-card {
  background: #ffffff !important;
  border: 1.5px solid rgba(226, 232, 240, 0.95);
  border-radius: var(--radius-xl);
  padding: 36px 30px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.35);
  position: relative;
  z-index: 10001;
}

.redirect-wa-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #0d9488;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.35);
}

.checkout-redirect-modal-card h3 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
}

.checkout-redirect-modal-card p {
  font-size: 0.92rem;
  color: #475569;
  line-height: 1.5;
  margin-bottom: 22px;
}

.btn-open-wa-manual {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #0d9488;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.96rem;
  padding: 14px 26px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  width: 100%;
  box-sizing: border-box;
  box-shadow: 0 4px 16px rgba(13, 148, 136, 0.3);
  transition: all var(--transition-fast);
}

.btn-open-wa-manual:hover {
  background: #0f766e;
  transform: translateY(-1px);
}

.btn-close-redirect-modal {
  margin-top: 14px;
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  text-decoration: underline;
}

/* Responsiva regler */
@media (max-width: 960px) {
  .checkout-grid-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .checkout-summary-card {
    position: static;
  }
}

@media (max-width: 600px) {
  .checkout-page-section {
    padding: 20px 0 50px;
  }
  .checkout-step-card {
    padding: 18px 14px;
  }
  .checkout-devices-bar {
    gap: 4px;
    padding: 4px;
  }
  .device-select-pill {
    padding: 10px 6px;
    font-size: 0.74rem;
  }
  .device-select-pill .pill-tv-icon {
    font-size: 0.85rem;
  }
  .form-two-cols {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .checkout-plan-card {
    padding: 14px 12px;
  }
  .plan-title-bold {
    font-size: 0.94rem;
  }
  .plan-main-kr {
    font-size: 1.12rem;
  }
  .btn-complete-order {
    font-size: 1rem;
    padding: 16px 18px;
  }
  .checkout-guarantee-bullets {
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 380px) {
  .device-select-pill {
    font-size: 0.68rem;
    padding: 8px 4px;
    gap: 4px;
  }
  .plan-card-left {
    gap: 10px;
  }
}
