/* ========================================
   PRICING CONFIGURATOR — Styles
   ======================================== */

.cfg-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.9rem; font-weight: 500; color: var(--primary);
  margin-bottom: 20px; transition: var(--transition);
}
.cfg-back:hover { gap: 10px; }

.cfg-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 48px;
  align-items: flex-start;
  max-width: 1100px;
  margin: 0 auto;
}

/* --- Config Sections --- */
.cfg-options { display: flex; flex-direction: column; gap: 0; }

.cfg-section {
  padding: 36px 0;
  border-bottom: 1px solid var(--border);
}
.cfg-section:first-child { padding-top: 0; }
.cfg-section:last-child { border-bottom: none; }

.cfg-section-title {
  font-size: 1.25rem; font-weight: 700; color: var(--text); margin-bottom: 6px;
}
.cfg-section-desc {
  font-size: 0.9rem; color: var(--text-muted); margin-bottom: 20px;
}

/* --- Stepper Input Row --- */
.cfg-input-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}

.cfg-stepper {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 1.3rem; font-weight: 500;
  color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  font-family: var(--font-body);
  line-height: 1;
  user-select: none;
}
.cfg-stepper:hover {
  border-color: var(--primary); color: var(--primary);
  background: var(--bg-alt);
}
.cfg-stepper:active { transform: scale(0.93); }

.cfg-number-input {
  width: 80px; height: 40px;
  text-align: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 1.1rem; font-weight: 600;
  color: var(--text); background: var(--surface);
  transition: var(--transition);
  -moz-appearance: textfield;
}
.cfg-number-input::-webkit-outer-spin-button,
.cfg-number-input::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
.cfg-number-input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(27,42,74,0.1);
}

.cfg-storage-input { width: 100px; }

.cfg-unit-price {
  font-size: 0.85rem; color: var(--text-muted); font-weight: 500;
}

/* --- Server Select --- */
.cfg-select-wrapper { position: relative; }

.cfg-select {
  width: 100%;
  padding: 14px 44px 14px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem; font-weight: 500;
  color: var(--text); background: var(--surface);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: var(--transition);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23636E72' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}
.cfg-select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(27,42,74,0.1);
}
.cfg-select:hover { border-color: var(--primary-light); }

.cfg-server-specs {
  margin-top: 10px;
  font-size: 0.82rem; font-weight: 600;
  color: var(--primary);
  background: var(--gradient-card);
  border: 1px solid var(--border);
  display: inline-block;
  padding: 5px 14px;
  border-radius: 100px;
}

.cfg-server-rec {
  margin-top: 6px;
  font-size: 0.8rem; font-weight: 600;
  color: #2a7d4f;
  display: block;
}

/* --- Self-Service Users Toggle --- */
.cfg-ss-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cfg-toggle {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
  cursor: pointer;
}
.cfg-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.cfg-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 100px;
  transition: var(--transition);
}
.cfg-toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.cfg-toggle input:checked + .cfg-toggle-slider {
  background: var(--primary);
}
.cfg-toggle input:checked + .cfg-toggle-slider::before {
  transform: translateX(24px);
}
.cfg-toggle input:focus-visible + .cfg-toggle-slider {
  box-shadow: 0 0 0 3px rgba(27,42,74,0.15);
}

.cfg-ss-body {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s cubic-bezier(0.4,0,0.2,1),
              opacity 0.3s ease,
              margin-top 0.3s ease;
  margin-top: 0;
}
.cfg-ss-body--open {
  max-height: 120px;
  opacity: 1;
  margin-top: 20px;
}

/* ========================================
   IMPLEMENTATION PACKAGES
   ======================================== */

/* Self-Implementation Badge */
.cfg-impl-self {
  margin-top: 20px;
  transition: opacity 0.3s ease, max-height 0.4s ease;
}
.cfg-impl-self.cfg-impl-self--hidden {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  margin-top: 0;
}
.cfg-impl-self-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}
.cfg-impl-self-icon {
  font-size: 1.1rem;
}

/* Implementation Body */
.cfg-impl-body {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.5s cubic-bezier(0.4,0,0.2,1),
              opacity 0.4s ease,
              margin-top 0.3s ease;
  margin-top: 0;
}
.cfg-impl-body--open {
  max-height: 800px;
  opacity: 1;
  margin-top: 24px;
}

/* Implementation Grid */
.cfg-impl-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* Implementation Card */
.cfg-impl-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
  transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  overflow: hidden;
}
.cfg-impl-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient);
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 0;
}
.cfg-impl-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}
.cfg-impl-card.cfg-impl-card--active {
  border-color: var(--primary);
  box-shadow: 0 8px 32px rgba(27,42,74,0.18);
}
.cfg-impl-card.cfg-impl-card--active::before {
  opacity: 0.04;
}
.cfg-impl-card > * {
  position: relative;
  z-index: 1;
}

/* Card Header */
.cfg-impl-card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
}
.cfg-impl-card-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  background: var(--gradient-card);
  border: 1px solid var(--border);
  padding: 3px 14px;
  border-radius: 100px;
}
.cfg-impl-badge-popular {
  background: linear-gradient(135deg, rgba(42,125,79,0.1), rgba(42,125,79,0.05));
  border-color: rgba(42,125,79,0.3);
  color: #2a7d4f;
}
.cfg-impl-badge-enterprise {
  background: var(--gradient);
  border-color: transparent;
  color: #fff;
}
.cfg-impl-card-hours {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

/* Card Price */
.cfg-impl-card-price {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2px;
}
.cfg-impl-card-perhr {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Card Stepper */
.cfg-impl-card-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.cfg-impl-card-stepper .cfg-number-input {
  width: 52px;
  height: 36px;
  font-size: 1rem;
}
.cfg-impl-stepper {
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
}

/* ========================================
   SUMMARY CARD — Implementation Section
   ======================================== */
.cfg-impl-summary {
  animation: fadeSlideUp 0.3s ease;
}

.cfg-impl-total-row {
  padding: 12px 0 4px;
}
.cfg-impl-total-row span:first-child {
  font-weight: 700;
  font-size: 0.95rem;
}
.cfg-impl-total-price {
  font-size: 1.2rem !important;
  font-weight: 800 !important;
  color: var(--primary) !important;
}

.cfg-impl-summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.cfg-impl-summary-line .cfg-price {
  font-size: 0.88rem;
}

/* --- Summary Card --- */
.cfg-summary-wrap {
  position: sticky;
  top: calc(var(--nav-height) + 24px);
}

.cfg-summary {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}
.cfg-summary:hover { box-shadow: var(--shadow-lg); }

.cfg-summary-inner { padding: 32px 28px; }

.cfg-summary-header {
  padding-bottom: 16px !important;
  margin-bottom: 4px;
}
.cfg-summary-label-monthly {
  font-size: 0.82rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted);
}

.cfg-summary-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0;
  font-size: 0.95rem; color: var(--text);
}

.cfg-ss-summary-row {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.cfg-price {
  font-family: var(--font-heading);
  font-weight: 600; white-space: nowrap;
}

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

.cfg-total-row {
  padding: 14px 0 8px;
}
.cfg-total-row span:first-child {
  font-weight: 700; font-size: 1rem;
}
.cfg-total-row sup { color: var(--text-muted); }

.cfg-total-price {
  font-size: 1.5rem !important; font-weight: 800 !important;
  color: var(--primary) !important;
}

.cfg-annual-note {
  text-align: right;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.cfg-annual-note strong {
  color: var(--text); font-weight: 700;
}

.cfg-buy-btn {
  width: 100%; text-align: center;
  padding: 16px 24px; font-size: 1.05rem;
  border-radius: var(--radius-md);
}

.cfg-quote-link {
  display: block; text-align: center; width: 100%;
  margin-top: 14px;
  font-size: 0.9rem; font-weight: 500;
  color: var(--primary);
  padding: 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  transition: var(--transition);
  background: var(--surface);
  cursor: pointer;
  font-family: var(--font-body);
}
.cfg-quote-link:hover {
  border-color: var(--primary); background: var(--bg-alt); color: var(--primary);
}

/* ========================================
   MODAL — Quote Send / OTP Flow
   ======================================== */
.cfg-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(27,42,74,0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.cfg-modal-overlay.cfg-modal--visible {
  display: flex;
  opacity: 1;
}
.cfg-modal-overlay.cfg-modal--animating {
  display: flex;
}

.cfg-modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 32px 80px rgba(27,42,74,0.3);
  position: relative;
  transform: translateY(20px) scale(0.97);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.4,0,0.2,1),
              opacity 0.3s ease;
}
.cfg-modal-overlay.cfg-modal--visible .cfg-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.cfg-modal-close {
  position: absolute;
  top: 16px; right: 20px;
  background: none; border: none;
  font-size: 1.8rem; color: var(--text-muted);
  cursor: pointer; transition: var(--transition);
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-family: var(--font-body);
}
.cfg-modal-close:hover {
  color: var(--text);
  background: var(--bg-alt);
}

/* Step Indicator */
.cfg-step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 32px;
}
.cfg-step {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.82rem; font-weight: 700;
  color: var(--text-muted);
  transition: all 0.3s ease;
}
.cfg-step.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.cfg-step.completed {
  background: #2a7d4f;
  border-color: #2a7d4f;
  color: #fff;
}
.cfg-step-line {
  width: 40px; height: 2px;
  background: var(--border);
  transition: background 0.3s ease;
}
.cfg-step-line.active {
  background: var(--primary);
}

/* Modal Content */
.cfg-modal-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  text-align: center;
}
.cfg-modal-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* Modal Form */
.cfg-modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cfg-modal-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.cfg-required { color: #c0392b; }
.cfg-optional { color: var(--text-light); font-weight: 400; font-size: 0.8rem; }

.cfg-modal-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  transition: var(--transition);
}
.cfg-modal-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(27,42,74,0.1);
}
.cfg-modal-input.cfg-input-error {
  border-color: #c0392b;
  box-shadow: 0 0 0 4px rgba(192,57,43,0.1);
}

.cfg-modal-btn {
  width: 100%;
  margin-top: 8px;
  padding: 14px 24px;
  font-size: 1rem;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.cfg-modal-error {
  color: #c0392b;
  font-size: 0.82rem;
  text-align: center;
  min-height: 1.2em;
  margin: 0;
}

/* OTP Inputs */
.cfg-otp-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.cfg-otp-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.cfg-otp-digit {
  width: 52px; height: 60px;
  text-align: center;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
  transition: var(--transition);
  caret-color: var(--primary);
}
.cfg-otp-digit:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(27,42,74,0.1);
}
.cfg-otp-digit.cfg-otp-filled {
  border-color: var(--primary);
  background: var(--bg-alt);
}
.cfg-otp-digit.cfg-otp-error {
  border-color: #c0392b;
  animation: shake 0.4s ease;
}

.cfg-resend-link {
  background: none; border: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--primary);
  cursor: pointer;
  text-decoration: underline;
  transition: var(--transition);
}
.cfg-resend-link:hover {
  color: var(--primary-dark);
}
.cfg-resend-link:disabled {
  color: var(--text-light);
  cursor: not-allowed;
  text-decoration: none;
}

/* Success */
.cfg-success-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2a7d4f, #3daa6f);
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  animation: successPop 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

/* Spinner */
.cfg-btn-spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* Animations */
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
@keyframes successPop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Server Recommendation States --- */
.cfg-server-rec--ok {
  color: #2a7d4f;
}
.cfg-server-rec--warning {
  color: #c0392b;
}

.cfg-server-upgrade-note {
  display: none;
  margin-top: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #7f6b20;
  background: #fef9e7;
  border: 1px solid #f5e6a3;
  border-radius: 8px;
  padding: 10px 14px;
  line-height: 1.5;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .cfg-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .cfg-summary-wrap {
    position: static;
  }
}
@media (max-width: 600px) {
  .cfg-impl-grid {
    grid-template-columns: 1fr;
  }
  .cfg-otp-digit {
    width: 44px;
    height: 52px;
    font-size: 1.2rem;
  }
  .cfg-otp-inputs {
    gap: 6px;
  }
  .cfg-modal {
    padding: 28px 20px;
  }
}
@media (max-width: 480px) {
  .cfg-input-row { gap: 8px; }
  .cfg-unit-price { width: 100%; margin-top: 4px; }
  .cfg-summary-inner { padding: 24px 20px; }
}

/* --- Auth Switch & Link Buttons --- */
.cfg-modal-switch {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 12px;
}
.cfg-link-btn {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: inherit;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  text-decoration: underline;
  transition: var(--transition);
  padding: 0;
}
.cfg-link-btn:hover { color: var(--primary-dark); }

/* --- User Status Bar --- */
.cfg-user-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 8px 0;
  box-shadow: 0 -2px 12px rgba(27,42,74,0.06);
}
.cfg-user-badge {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-alt);
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
}

/* Email Verification Banner */
.cfg-verify-banner {
  background: linear-gradient(135deg, #fff3cd, #ffeeba);
  border-bottom: 1px solid #f0d77c;
  padding: 10px 0;
  font-size: 0.85rem;
  color: #856404;
  position: relative;
  z-index: 50;
}
