:root {
  color-scheme: light;
  --cream: #faf8f5;
  --sand: #f5f0e8;
  --tan: #e8e0d4;
  --gold: #b8a88a;
  --coffee: #3a3028;
  --mocha: #5a4d3d;
  --stone: #7a6b5a;
  --rust: #c89040;
  --ink: #1a1a2e;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(135deg, #faf8f5 0%, #f5f0e8 40%, #e8e0d4 100%);
  color: var(--coffee);
  overflow-x: hidden;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 24px;
  align-items: center;
  padding: 24px 0;
}

.card {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(184, 168, 138, 0.2);
  box-shadow: 0 24px 80px rgba(58, 48, 40, 0.1);
  border-radius: 28px;
  padding: 34px;
  backdrop-filter: blur(20px);
}

.hero-card {
  background: linear-gradient(135deg, #3a3028 0%, #4a3d32 40%, #5a4d3d 70%, #6a5d4d 100%);
  color: var(--cream);
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 14px;
}

.logo-img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: contain;
}

.mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #d4a853 0%, #c89040 100%);
  display: inline-grid;
  place-items: center;
  color: var(--coffee);
  font-size: 16px;
}

h1 {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 0.94;
  margin: 28px 0 18px;
  font-weight: 700;
}

h2 {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: clamp(22px, 3vw, 28px);
  margin: 0 0 18px;
  font-weight: 600;
  color: var(--coffee);
}

.hero-card p {
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.55;
  color: rgba(250, 248, 245, 0.78);
  max-width: 650px;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.badges span {
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 13px;
  color: rgba(250, 248, 245, 0.85);
}

.status {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(232, 224, 212, 0.5);
  color: var(--mocha);
  font-size: 14px;
  margin-bottom: 18px;
  border: 1px solid rgba(184, 168, 138, 0.2);
}

.status-spinner {
  display: none;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 2px solid rgba(184, 168, 138, 0.35);
  border-top-color: var(--rust);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.status.loading .status-spinner {
  display: inline-block;
}

.status-text {
  line-height: 1.35;
}

.status:empty {
  display: none;
}

.status.ok {
  background: rgba(74, 124, 89, 0.1);
  color: #4a7c59;
  border-color: rgba(74, 124, 89, 0.2);
}

.status.err {
  background: rgba(200, 80, 40, 0.08);
  color: #b5653d;
  border-color: rgba(200, 80, 40, 0.2);
}

.panel { display: none; }
.panel.active { display: block; }

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--mocha);
  margin: 18px 0 8px;
  letter-spacing: 0.01em;
}

input, select, textarea {
  width: 100%;
  border: 1px solid rgba(184, 168, 138, 0.35);
  border-radius: 14px;
  padding: 13px 14px;
  background: #fff;
  color: var(--coffee);
  font: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea {
  resize: vertical;
  min-height: 104px;
  line-height: 1.5;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--rust);
  box-shadow: 0 0 0 4px rgba(200, 144, 64, 0.12);
}

input::placeholder, textarea::placeholder {
  color: var(--stone);
  opacity: 0.6;
}

.consent-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0 4px;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 500;
  color: var(--stone);
  letter-spacing: 0;
}

.consent-row input {
  width: 18px;
  height: 18px;
  padding: 0;
  margin: 1px 0 0;
  accent-color: var(--coffee);
  cursor: pointer;
}

.consent-row a {
  color: var(--coffee);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

button, .link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  font-weight: 700;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  margin-top: 18px;
  width: 100%;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  font-size: 15px;
}

button:hover, .link:hover {
  transform: translateY(-1px);
}

button:disabled, button:disabled:hover, .text-btn:disabled, .text-btn:disabled:hover {
  cursor: not-allowed;
  transform: none;
}

.primary {
  background: linear-gradient(135deg, #3a3028 0%, #4a3d32 100%);
  color: var(--cream);
  box-shadow: 0 12px 30px rgba(58, 48, 40, 0.22);
}

.primary:hover {
  box-shadow: 0 16px 40px rgba(58, 48, 40, 0.3);
}

.primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.primary:disabled:hover {
  box-shadow: none;
  transform: none;
}

#onboardingPanel .primary.is-loading,
#onboardingPanel .ghost.is-loading,
#onboardingPanel .link.is-loading {
  opacity: 0.78;
  cursor: wait;
  pointer-events: none;
  gap: 10px;
}

.onboarding-button-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: spin 0.75s linear infinite;
  opacity: 0.9;
}

.ghost .onboarding-button-spinner {
  color: var(--mocha);
}

.ghost {
  background: transparent;
  color: var(--mocha);
  border: 1px solid rgba(184, 168, 138, 0.35);
}

.ghost:hover {
  background: rgba(184, 168, 138, 0.08);
}

.tiny, .muted {
  color: var(--stone);
  font-size: 13px;
}

.tiny {
  line-height: 1.5;
  margin-top: 12px;
}

.muted {
  font-weight: 400;
  opacity: 0.7;
}

.checkout-summary {
  margin: 18px 0 12px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(250,248,245,0.95), rgba(243,234,220,0.76));
  border: 1px solid rgba(184, 168, 138, 0.28);
  color: var(--coffee);
  box-shadow: 0 14px 34px rgba(58,48,40,0.08);
}

.checkout-price-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.checkout-summary-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone);
}

.checkout-summary-sub {
  margin-top: 4px;
  color: var(--stone);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 500;
}

.checkout-price-block {
  text-align: right;
  flex: 0 0 auto;
}

.checkout-price {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  color: var(--coffee);
  font-family: Georgia, serif;
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}

.checkout-price-symbol {
  font-size: 0.68em;
  line-height: 1;
  transform: translateY(-0.02em);
}

.checkout-price-amount {
  line-height: 1;
}

.checkout-discount-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(184, 168, 138, 0.22);
  color: var(--coffee);
  font-size: 14px;
  font-weight: 700;
}

.checkout-discount-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(200, 144, 64, 0.14);
  color: var(--rust);
  border: 1px solid rgba(200, 144, 64, 0.28);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.checkout-standard-row {
  margin-top: 8px;
  color: var(--stone);
  font-size: 13px;
  line-height: 1.45;
}

.uplido-post-trial-onboarding.active {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(42, 31, 24, 0.42);
  backdrop-filter: blur(18px);
}

.onboarding-modal-card {
  width: min(520px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  overflow: auto;
  border-radius: 28px;
  padding: 28px;
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.98), rgba(245, 240, 232, 0.96));
  border: 1px solid rgba(184, 168, 138, 0.36);
  box-shadow: 0 28px 90px rgba(42, 31, 24, 0.28);
}

.onboarding-progress {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
}

.onboarding-progress span {
  height: 6px;
  flex: 1;
  border-radius: 999px;
  background: rgba(184, 168, 138, 0.28);
}

.onboarding-progress span.active {
  background: linear-gradient(135deg, #3a3028 0%, #c89040 100%);
}

.onboarding-step { display: none; }
.onboarding-step.active { display: block; }

.onboarding-kicker {
  margin: 0 0 8px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--rust);
}

.onboarding-copy {
  margin: -6px 0 18px;
  line-height: 1.55;
}

.same-as-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  color: var(--coffee);
  font-size: 13px;
  font-weight: 700;
}

.same-as-row input {
  width: 18px;
  height: 18px;
  padding: 0;
  margin: 0;
  accent-color: var(--coffee);
}

#onboardingBillingName[readonly] {
  background: rgba(250, 248, 245, 0.78);
  color: var(--stone);
}

@media (max-width: 520px) {
  .checkout-price-row {
    flex-direction: column;
    gap: 10px;
  }

  .checkout-price-block {
    text-align: left;
  }
}

.checkout-note {
  color: var(--stone);
  font-size: 14px;
  line-height: 1.65;
  margin: 10px 0 0;
}

.text-link {
  color: var(--rust);
  text-decoration: none;
  font-weight: 600;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  width: auto;
  display: inline;
  cursor: pointer;
}

.text-link:hover {
  text-decoration: underline;
}

.text-btn {
  background: none;
  border: none;
  color: var(--rust);
  font-weight: 600;
  padding: 0;
  margin: 0;
  width: auto;
  display: inline;
  cursor: pointer;
  font-size: inherit;
}

.text-btn:hover {
  text-decoration: underline;
}

.text-btn:disabled {
  color: var(--stone);
  opacity: 0.72;
}

/* Coupon applied badge */
.coupon-applied {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(200, 144, 64, 0.1);
  border: 1px solid rgba(200, 144, 64, 0.25);
  color: var(--rust);
  font-size: 13px;
  font-weight: 600;
  margin-top: 8px;
}

/* Plan cards */
.plan-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 14px 0;
}

.plan-card {
  padding: 16px 12px;
  border-radius: 16px;
  border: 2px solid rgba(184, 168, 138, 0.2);
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.plan-card:hover {
  border-color: rgba(184, 168, 138, 0.4);
}

.plan-card.selected {
  border-color: var(--rust);
  background: rgba(200, 144, 64, 0.06);
  box-shadow: 0 4px 16px rgba(200, 144, 64, 0.1);
}

.plan-card .plan-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--coffee);
  margin-bottom: 4px;
}

.plan-card .plan-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--coffee);
}

.plan-card .plan-price span {
  font-size: 13px;
  font-weight: 500;
  color: var(--stone);
}

.plan-card .plan-desc {
  font-size: 11px;
  color: var(--stone);
  margin-top: 6px;
  line-height: 1.4;
}

/* Divider */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--gold) 50%, transparent 100%);
  margin: 20px 0;
  opacity: 0.4;
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(184, 168, 138, 0.3);
  border-top-color: var(--rust);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

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

/* Responsive */
@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 16px;
    width: 100%;
  }

  .hero-card {
    min-height: auto;
    padding: 28px 24px;
  }

  .card {
    padding: 24px;
    border-radius: 20px;
  }

  h1 {
    font-size: clamp(28px, 8vw, 42px);
  }

  .plan-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .shell {
    padding: 12px;
    gap: 12px;
  }

  .card {
    padding: 20px;
    border-radius: 16px;
  }

  .hero-card {
    padding: 24px 20px;
  }

  h1 {
    font-size: 28px;
    margin: 20px 0 14px;
  }

  h2 {
    font-size: 20px;
  }

  .hero-card p {
    font-size: 15px;
  }

  .badges {
    gap: 8px;
  }

  .badges span {
    font-size: 12px;
    padding: 7px 10px;
  }

  input, select, textarea, button, .link {
    padding: 12px 14px;
    font-size: 16px; /* Prevents iOS zoom */
  }

  .brand {
    font-size: 12px;
  }

  .mark {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }
}

/* Touch device optimizations */
@media (hover: none) {
  button:active, .link:active {
    transform: scale(0.98);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
