/**
 * Smart Pricing Tables Scoped CSS.
 * Provides rich premium Google-inspired aesthetics scoped to prevent theme pollution.
 */

.spt-pricing-table {
  /* Design System Tokens */
  --spt-blue: #1a73e8;
  --spt-blue-light: #e8f0fe;
  --spt-blue-hover: #1557b0;
  --spt-green: #1e8e3e;
  --spt-green-bg: #e6f4ea;
  --spt-border: #dadce0;
  --spt-bg-gray: #f8f9fa;
  --spt-text-dark: #3c4043;
  --spt-text-gray: #5f6368;

  color: var(--spt-text-dark);
  margin: 2rem auto;
  max-width: 1280px;
  width: 100%;
}

.spt-pricing-table * {
  box-sizing: border-box;
}

.spt-pricing-table .spt-wrapper {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 24px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.02);
  overflow: hidden;
}

/* HEADER SECTION */
.spt-pricing-table .spt-header {
  padding: 1.5rem 2rem;
  background-color: rgba(241, 243, 244, 0.35);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

/* User Stepper Selector */
.spt-pricing-table .spt-user-selector {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.spt-pricing-table .spt-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--spt-text-gray);
}

.spt-pricing-table .spt-stepper {
  display: flex;
  align-items: center;
  border: 1px solid var(--spt-border);
  border-radius: 8px;
  background: #ffffff;
  padding: 2px 6px;
  position: relative;
  transition: border-color 0.2s;
}

.spt-pricing-table .spt-stepper:focus-within {
  border-color: var(--spt-blue);
}

.spt-pricing-table .spt-user-input {
  width: 55px;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 4px 0;
  color: var(--spt-text-dark);
  -moz-appearance: textfield;
}

.spt-pricing-table .spt-user-input::-webkit-outer-spin-button,
.spt-pricing-table .spt-user-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.spt-pricing-table .spt-stepper-buttons {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-left: 2px;
}

.spt-pricing-table .spt-stepper-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: #9aa0a6;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  transition: color 0.15s;
}

.spt-pricing-table .spt-stepper-btn:hover {
  color: var(--spt-blue);
}

.spt-pricing-table .spt-stepper-btn svg {
  width: 12px;
  height: 12px;
}

/* Toggle Switch Styles */
.spt-pricing-table .spt-toggle-switch {
  position: relative;
  display: inline-flex;
  height: 20px;
  width: 36px;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 9999px;
  border: 2px solid transparent;
  background-color: #dadce0;
  transition: background-color 0.2s ease-in-out;
  outline: none;
  padding: 0;
}

.spt-pricing-table .spt-toggle-switch.spt-active {
  background-color: var(--spt-blue);
}

.spt-pricing-table .spt-toggle-handle {
  pointer-events: none;
  inline-size: 16px;
  block-size: 16px;
  border-radius: 9999px;
  background-color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease-in-out;
  transform: translateX(0);
}

.spt-pricing-table .spt-toggle-switch.spt-active .spt-toggle-handle {
  transform: translateX(16px);
}

/* Billing Toggle Panel */
.spt-pricing-table .spt-billing-selector,
.spt-pricing-table .spt-addon-wrapper,
.spt-pricing-table .spt-team-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.spt-pricing-table .spt-billing-label,
.spt-pricing-table .spt-addon-label,
.spt-pricing-table .spt-team-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--spt-text-gray);
}

.spt-pricing-table .spt-team-label {
  white-space: nowrap;
}

.spt-pricing-table .spt-discount-text {
  color: var(--spt-green);
  font-weight: 600;
  margin-left: 2px;
}

.spt-pricing-table .spt-addon-cost {
  color: var(--spt-blue);
  font-weight: 600;
}

/* PRICING GRID */
.spt-pricing-table .spt-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 1.5rem;
}

@media (min-width: 768px) {
  .spt-pricing-table .spt-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 2rem;
    gap: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .spt-pricing-table .spt-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .spt-pricing-table .spt-grid.cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }
  .spt-pricing-table .spt-grid:not(.cols-3):not(.cols-4) {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

/* PRICING CARD */
.spt-pricing-table .spt-card {
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  border-radius: 20px;
  border: 1px solid transparent;
  background: #ffffff;
  position: relative;
  transition:
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

/* Highlighted Plan */
.spt-pricing-table .spt-card.spt-highlighted {
  border-color: var(--spt-blue);
  box-shadow: 0 8px 24px rgba(26, 115, 232, 0.08);
}

.spt-pricing-table .spt-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--spt-blue);
  color: #ffffff;
  padding: 4px 12px;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(26, 115, 232, 0.2);
}

.spt-pricing-table .spt-card-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 20px 0;
  color: var(--spt-text-dark);
	line-height: 1;
}

.spt-pricing-table .spt-card-tagline {
  background-color: var(--spt-green-bg);
  color: var(--spt-green);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 9999px;
  display: inline-block;
  text-transform: uppercase;
  margin: 0 0 1.5rem 0;
  width: max-content;
}

/* Dynamic Pricing Display */
.spt-pricing-table .spt-price-container {
  margin-bottom: 2rem;
}

.spt-pricing-table .spt-price-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.spt-pricing-table .spt-price-display {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--spt-text-dark);
  line-height: 1.1;
  transition: font-size 0.2s ease;
  font-family: "degular", sans-serif !important
}

.spt-pricing-table .spt-price-display.spt-contact-mode {
  font-size: 1.75rem;
  color: var(--spt-text-dark);
  font-weight: 500;
}

.spt-pricing-table .spt-card-original-price {
  color: var(--spt-text-gray);
  text-decoration: line-through;
  font-size: 0.9rem;
  font-weight: 400;
}

.spt-pricing-table .spt-price-period {
  color: var(--spt-text-gray);
  font-size: 0.8rem;
  margin: 0.25rem 0 0 0;
}

/* CTA Buttons */
.spt-pricing-table .spt-cta-container {
  margin-bottom: 2rem;
}

.spt-pricing-table .spt-cta-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.15s,
    color 0.15s,
    border-color 0.15s,
    box-shadow 0.15s;
  border: 1px solid transparent;
  outline: none;
  box-shadow: none;
}

.spt-pricing-table .spt-btn-primary {
  background-color: var(--spt-blue);
  color: #ffffff;
}

.spt-pricing-table .spt-btn-primary:hover {
  background-color: var(--spt-blue-hover);
}

.spt-pricing-table .spt-btn-secondary {
  background-color: transparent;
  border-color: var(--fs-color-primary);
  color: var(--spt-blue);
}

.spt-pricing-table .spt-btn-secondary:hover {
  background-color: var(--fs-color-primary);
  color: #ffffff;
}

/* Loading animations on buttons */
.spt-pricing-table .spt-cta-btn.spt-loading {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
  position: relative;
  color: transparent !important;
}

.spt-pricing-table .spt-cta-btn.spt-loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-top: -8px;
  margin-left: -8px;
  border: 2px solid rgba(26, 115, 232, 0.2);
  border-top-color: var(--spt-blue);
  border-radius: 50%;
  animation: spt-spin 0.8s linear infinite;
}

.spt-pricing-table .spt-btn-primary.spt-loading::after {
  border-color: rgba(255, 255, 255, 0.2);
  border-top-color: #ffffff;
}

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

.spt-pricing-table .spt-features-header {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--spt-text-gray);
  letter-spacing: 0.5px;
  margin: 0 0 1rem 0;
}

.spt-pricing-table .spt-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.spt-pricing-table .spt-feature-item {
  display: flex;
  align-items: flex-start;
  font-size: .9rem;
  line-height: 1.4;
  margin-left: 0px;
}

.spt-pricing-table .spt-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  margin-right: 15px;
  flex-shrink: 0;
  margin-top: 1px;
  line-height: 1;
}

.spt-pricing-table .spt-icon-check {
  color: var(--spt-green);
  width: 14px;
  height: 14px;
}

.spt-pricing-table .spt-icon-cross {
  color: #9aa0a6;
  width: 14px;
  height: 14px;
}

.spt-pricing-table .spt-feature-text {
  color: var(--spt-text-dark);
}

.spt-pricing-table .spt-feature-item.spt-unavailable .spt-feature-text {
  color: var(--spt-text-gray);
}

/* FOOTER SECTION */
.spt-pricing-table .spt-footer {
  padding: 1rem 2rem;
  background-color: rgba(241, 243, 244, 0.35);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  color: var(--spt-text-gray);
}

.spt-pricing-table .spt-footer p {
  margin: 0;
}

/* Error States */
.spt-error {
  background: #fdf2f2;
  border: 1px solid #f8b4b4;
  color: #9b1c1c;
  padding: 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin: 1rem 0;
}

/* Domain Bottom Sheet Overlay */
.spt-domain-sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  visibility: hidden;
  pointer-events: none;
}

.spt-domain-sheet-overlay.spt-sheet-open {
  visibility: visible;
  pointer-events: auto;
}

/* Backdrop */
.spt-domain-sheet-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s ease;
}

.spt-domain-sheet-overlay.spt-sheet-open .spt-domain-sheet-backdrop {
  background: rgba(0, 0, 0, 0.45);
}

/* Bottom Sheet Container */
.spt-domain-sheet {
  position: relative;
  width: 100%;
  max-width: 1340px;
  max-height: 90vh;
  background: #ffffff;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.12);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.spt-domain-sheet-overlay.spt-sheet-open .spt-domain-sheet {
  transform: translateY(0);
}

/* Drag Handle Area */
.spt-sheet-drag-area {
  display: flex;
  justify-content: center;
  padding: 12px 0 4px;
  cursor: grab;
}

.spt-sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: #e0e0e0;
  transition: background 0.15s ease;
}

.spt-sheet-drag-area:hover .spt-sheet-handle {
  background: #ccc;
}

/* Sheet Header */
.spt-sheet-header {
  padding: 8px 24px 0;
}

.spt-sheet-title {
  margin: 0 0 4px;
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a2e;
  line-height: 1.3;
}

.spt-sheet-subtitle {
  margin: 0;
  font-size: 0.85rem;
  color: #6b7280;
  line-height: 1.5;
}

/* Sheet Body */
.spt-sheet-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.spt-sheet-body .spt-domain-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

/* Domain Option Cards */
.spt-domain-option-card {
  border: 1px solid #f0f0f0;
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

.spt-domain-option-card:hover {
  border-color: #e0e0e0;
  background-color: #fafafa;
}

.spt-domain-option-card.spt-active {
  border-color: #1a73e8;
  background: linear-gradient(135deg, #f0f7ff 0%, #e8f0fe 100%);
}

.spt-domain-option-header {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  margin-bottom: 0;
}

.spt-domain-option-header input[type="radio"] {
  display: none;
}

/* Option Icon */
.spt-domain-option-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #f1f5f9;
  color: #64748b;
  flex-shrink: 0;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.spt-domain-option-card.spt-active .spt-domain-option-icon {
  background: #1a73e8;
  color: #ffffff;
}

/* Option Text */
.spt-domain-option-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.spt-domain-option-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: #1a1a2e;
  line-height: 1.3;
}

.spt-domain-option-desc {
  font-size: 0.78rem;
  color: #9ca3af;
  line-height: 1.4;
  font-weight: 400;
}

/* Domain Input Group */
.spt-domain-input-group {
  margin-top: 14px;
  padding-left: 0;
}

.spt-field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 400;
  color: #6b7280;
  margin-bottom: 6px;
  letter-spacing: 0.03em;
}

.spt-domain-select,
.spt-domain-input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 0.9rem;
  color: #1a1a2e;
  background: #ffffff;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.spt-domain-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding: 0 20px;
}

.spt-domain-select:focus,
.spt-domain-input:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}

/* Domain Search Row */
.spt-domain-search-row {
  display: flex;
  gap: 8px;
}

.spt-domain-search-row .spt-domain-input {
  flex: 1;
}

.spt-btn-search-domain {
  height: 40px;
  padding: 0 60px;
  border: none;
  border-radius: 12px;
  background: #1a73e8;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition:
    background-color 0.15s ease,
    transform 0.1s ease;
}

.spt-btn-search-domain:hover {
  background: #1557b0;
}

.spt-btn-search-domain:active {
  transform: scale(0.97);
}

.spt-btn-search-domain:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.spt-btn-search-domain.spt-verifying {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.spt-btn-search-domain.spt-verifying::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spt-spin 0.7s linear infinite;
}

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

/* Domain Verify */
.spt-domain-verify-msg,
.spt-domain-search-msg,
.spt-domain-transfer-msg {
  margin: 8px 0 0;
  font-size: 0.8rem;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 6px;
}

.spt-domain-verify-msg.spt-msg-error,
.spt-domain-search-msg.spt-msg-error,
.spt-domain-transfer-msg.spt-msg-error {
  color: #dc2626;
}

.spt-domain-verify-msg.spt-msg-success,
.spt-domain-search-msg.spt-msg-success,
.spt-domain-transfer-msg.spt-msg-success {
  color: #16a34a;
}

.spt-domain-input.spt-input-error {
  border-color: #dc2626;
}

.spt-domain-input.spt-input-error:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.spt-domain-input.spt-input-valid {
  border-color: #16a34a;
}

.spt-domain-input.spt-input-valid:focus {
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

/* Transfer Fields */
.spt-transfer-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Sheet Footer */
.spt-sheet-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid #f0f0f0;
  background: #fafbfc;
}

.spt-sheet-footer .spt-cta-btn {
  width: auto;
  min-width: 120px;
  height: 44px;
  padding: 0 24px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    transform 0.1s ease;
  border: none;
  outline: none;
}

.spt-sheet-footer .spt-cta-btn:active {
  transform: scale(0.98);
}

.spt-sheet-footer .spt-btn-primary {
  background-color: #1a73e8;
  color: #ffffff;
}

.spt-sheet-footer .spt-btn-primary:hover {
  background-color: #1557b0;
}

.spt-sheet-footer .spt-btn-secondary {
  background-color: #f1f5f9;
  color: #475569;
}

.spt-sheet-footer .spt-btn-secondary:hover {
  background-color: #e2e8f0;
}

/* Body scroll lock when sheet is open */
body.spt-sheet-active {
  overflow: hidden;
}

/* Safe area for mobile notched devices */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .spt-sheet-footer {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
}

/* Mobile adjustments */
@media (max-width: 600px) {
  .spt-domain-sheet {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
  }

  .spt-sheet-header {
    padding: 8px 20px 0;
  }

  .spt-sheet-body {
    padding: 16px 20px;
  }

  .spt-sheet-body .spt-domain-options-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .spt-sheet-footer {
    padding: 14px 20px;
  }

  .spt-domain-option-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }
}

.spt-pricing-table .spt-toggle-switch {
  margin-bottom: 0 !important;
  margin-right: 0 !important;
}
.spt-stepper input {
  margin-bottom: 0 !important;
  margin-right: 0 !important;
  min-height: unset !important;
}
.spt-header * {
  min-height: unset !important;
}
