/* ============================================
   Revia Subscription Modal
   All selectors scoped under #revia-modal
   ============================================ */

:root {
  --ghost-accent-color: #2dd4bf;
}

/* Backdrop */
#revia-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999999;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 200ms ease;
}

#revia-modal-backdrop.is-visible {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#revia-modal-backdrop.is-active {
  opacity: 1;
}

/* Container — wide for tier selection, narrow for forms */
#revia-modal {
  background: #fff;
  border-radius: 10px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 200ms ease, opacity 200ms ease, max-width 300ms ease;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: #111827;
}

/* Narrow modal for form steps */
#revia-modal.is-narrow {
  max-width: 360px;
}

#revia-modal.is-upgrade-only {
  max-width: 420px;
}

#revia-modal.is-simple-signup {
  max-width: 480px;
  border-radius: 7.5px;
}

#revia-modal-backdrop.is-active #revia-modal {
  transform: translateY(0);
  opacity: 1;
}

/* Close button */
#revia-modal-close {
  position: absolute;
  top: 7.5px;
  right: 7.5px;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 3.75px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 12.5px;
  line-height: 1;
  z-index: 1;
  transition: color 150ms ease, background 150ms ease;
}

#revia-modal-close:hover {
  color: #374151;
  background: #f4f4f5;
}

/* Content area */
#revia-modal-content {
  padding: 35px 30px;
}

#revia-modal.is-narrow #revia-modal-content {
  padding: 25px;
}

#revia-modal.is-upgrade-only #revia-modal-content {
  padding: 32.5px 30px 27.5px;
}

#revia-modal.is-simple-signup #revia-modal-content {
  padding: 45px 40px 42.5px;
}


/* ---- Progress indicator ---- */
.revia-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-bottom: 15px;
}

.revia-progress-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #e5e7eb;
  transition: background 200ms ease;
}

.revia-progress-dot.is-active {
  background: #111827;
}

.revia-progress-dot.is-done {
  background: #22c55e;
}

/* ---- Typography ---- */
#revia-modal .rm-title {
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.025em;
  text-align: center;
  margin-bottom: 7.5px;
}

#revia-modal .rm-subtitle {
  font-size: 11.25px;
  font-weight: 500;
  color: #6b7280;
  text-align: center;
  margin-bottom: 20px;
}

/* Smaller titles for form steps */
#revia-modal.is-narrow .rm-title {
  font-size: 17.5px;
  margin-bottom: 5px;
}

#revia-modal.is-narrow .rm-subtitle {
  font-size: 10px;
  font-weight: 400;
  margin-bottom: 15px;
}

#revia-modal.is-upgrade-only .rm-title {
  font-size: 20px;
  margin-bottom: 5px;
}

#revia-modal.is-upgrade-only .rm-subtitle {
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
  font-size: 10px;
  font-weight: 400;
}

/* ---- Prefilled email from landing overlay ---- */
.revia-prefilled-email {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6.25px;
  margin: -7.5px auto 15px;
  color: #6b7280;
  font-size: 8.75px;
}

.revia-prefilled-email span {
  max-width: min(240px, 100%);
  padding: 3.75px 7.5px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f9fafb;
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.revia-prefilled-email button {
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  font-family: inherit;
  font-size: 8.75px;
  font-weight: 600;
  padding: 3.75px 0;
}

.revia-prefilled-email button:hover {
  color: #111827;
}

.revia-inline-email-form {
  display: flex;
  align-items: stretch;
  gap: 5px;
  max-width: 240px;
  margin: -7.5px auto 15px;
}

.revia-inline-email-form input {
  min-width: 0;
  flex: 1;
  padding: 6.25px 8.75px;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  color: #111827;
  font-family: inherit;
  font-size: 9.375px;
  outline: none;
}

.revia-inline-email-form input:focus {
  border-color: #111827;
}

.revia-inline-email-form button {
  padding: 6.25px 8.75px;
  border: none;
  border-radius: 5px;
  background: #111827;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 8.75px;
  font-weight: 600;
}

/* ---- Simple newsletter signup ---- */
.revia-simple-signup {
  width: min(100%, 430px);
  margin: 0 auto;
}

.revia-modal-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 74px;
  margin: 0 auto 22px;
}

.revia-modal-brand img {
  width: auto;
  max-width: min(100%, 380px);
  max-height: 74px;
  object-fit: contain;
}

.revia-modal-brand span {
  color: #2dd4bf;
  font-size: clamp(24px, 5vw, 42px);
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
}

.revia-simple-signup-copy {
  max-width: 360px;
  margin: 0 auto 30px;
  color: #252525;
  font-size: clamp(16.5px, 2.6vw, 23.2px);
  font-weight: 430;
  letter-spacing: 0;
  line-height: 1.55;
}

.revia-simple-signup-form {
  display: flex;
  align-items: center;
  gap: 7.5px;
  width: min(100%, 360px);
  min-height: 70px;
  padding: 3.5px;
  margin: 0 auto;
  border: 1px solid #d9d9d9;
  border-radius: 999px;
  background: #fff;
}

.revia-simple-signup-form input[type="email"] {
  min-width: 0;
  flex: 1;
  height: 58px;
  padding: 0 17px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #252525;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 430;
  letter-spacing: 0;
  outline: none;
}

.revia-simple-signup-form input[type="email"]::placeholder {
  color: #6f6f6f;
  opacity: 1;
}

.revia-simple-signup-form:focus-within {
  border-color: #2dd4bf;
  box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.14);
}

.revia-simple-signup-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 130px;
  height: 58px;
  padding: 0 16.5px;
  border: 0;
  border-radius: 999px;
  background: #2dd4bf;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 12.4px;
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1;
  transition: background 150ms ease, transform 150ms ease;
}

.revia-simple-signup-submit:hover,
.revia-simple-signup-submit:focus-visible {
  background: #14b8a6;
  outline: none;
  transform: translateY(-1px);
}

.revia-simple-signup-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.revia-simple-signup .revia-error {
  width: min(100%, 360px);
  margin: 0 auto 10px;
}

/* ---- Cadence toggle ---- */
.revia-cadence-toggle {
  display: flex;
  background: #f4f4f5;
  border-radius: 5px;
  padding: 2.5px;
  margin: 0 auto 25px;
  width: fit-content;
}

.revia-cadence-btn {
  padding: 5px 15px;
  border-radius: 3.75px;
  font-size: 8.75px;
  font-weight: 500;
  color: #6b7280;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  transition: all 150ms ease;
}

.revia-cadence-btn.is-active {
  background: #fff;
  color: #111827;
  border-color: #d1d5db;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.revia-cadence-btn:not(.is-active):hover {
  color: #374151;
}

/* ---- Tier cards (2-column grid: Free + Paid) ---- */
.revia-tiers {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-bottom: 15px;
  align-items: stretch;
}

.revia-tiers.is-upgrade-only {
  grid-template-columns: minmax(0, 280px);
  justify-content: center;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

.revia-tier-card {
  background: #fff;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 10px;
  padding: 25px 25px;
  display: flex;
  flex-direction: column;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.revia-tier-card:hover {
  border-color: rgba(17, 24, 39, 0.3);
}

.revia-tier-card.is-featured {
  background: #111827;
  color: #fff;
  border-color: transparent;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.revia-tiers.is-upgrade-only .revia-tier-card.is-featured {
  border-radius: 5px;
  box-shadow: 0 24px 48px -26px rgba(17, 24, 39, 0.65);
}

.revia-tier-label {
  font-size: 8.75px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ff6600;
}

.revia-tier-card.is-featured .revia-tier-label {
  color: #a5b4fc;
}

.revia-tier-name {
  font-size: 20px;
  font-weight: 600;
  margin-top: 5px;
  letter-spacing: -0.01em;
}

.revia-tiers.is-upgrade-only .revia-tier-name {
  font-size: 18.75px;
}

.revia-tier-desc {
  font-size: 10.625px;
  color: #6b7280;
  margin-top: 5px;
  line-height: 1.5;
}

.revia-tiers.is-upgrade-only .revia-tier-desc {
  font-size: 10px;
}

.revia-tier-card.is-featured .revia-tier-desc {
  color: #9ca3af;
}

.revia-tier-price-block {
  margin-top: 10px;
  display: flex;
  align-items: baseline;
  gap: 2.5px;
}

.revia-tier-price-currency {
  font-size: 15px;
  font-weight: 400;
  color: #a1a1aa;
}

.revia-tier-card.is-featured .revia-tier-price-currency {
  color: #6b7280;
}

.revia-tier-price-amount {
  font-size: 32.5px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1;
}

.revia-tiers.is-upgrade-only .revia-tier-price-amount {
  font-size: 30px;
}

.revia-tier-price-cadence {
  font-size: 10px;
  color: #6b7280;
  margin-left: 2.5px;
}

.revia-tier-card.is-featured .revia-tier-price-cadence {
  color: #9ca3af;
}

.revia-tier-features {
  margin-top: 17.5px;
  display: flex;
  flex-direction: column;
  gap: 8.75px;
  flex: 1;
}

.revia-tier-feature {
  display: flex;
  align-items: flex-start;
  gap: 7.5px;
  font-size: 11.25px;
  line-height: 1.5;
  color: #4b5563;
}

.revia-tier-card.is-featured .revia-tier-feature {
  color: #d1d5db;
}

.revia-tier-feature svg {
  width: 12.5px;
  height: 12.5px;
  flex-shrink: 0;
  margin-top: 1.25px;
}

.revia-tier-check-accent { color: #ff6600; }
.revia-tier-check-light { color: #a5b4fc; }

.revia-tier-btn {
  display: block;
  width: 100%;
  padding: 10px 20px;
  border-radius: 5px;
  font-size: 11.25px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 150ms ease;
  margin-top: 12.5px;
  border: none;
  font-family: inherit;
}

.revia-tier-btn-primary {
  background: #111827;
  color: #fff;
}

.revia-tier-btn-primary:hover {
  background: #1f2937;
}

.revia-tier-btn-featured {
  background: #fff;
  color: #111827;
}

.revia-tier-btn-featured:hover {
  background: #f4f4f5;
}

.revia-tier-btn-outline {
  background: transparent;
  color: #111827;
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.15);
}

.revia-tier-btn-outline:hover {
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.3);
}

/* ---- Form fields ---- */
.revia-form-group {
  margin-bottom: 10px;
}

.revia-form-group label {
  display: block;
  font-size: 9.375px;
  font-weight: 500;
  margin-bottom: 5px;
  color: #374151;
}

.revia-form-group input {
  width: 100%;
  padding: 7.5px 10px;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  font-size: 10px;
  font-family: inherit;
  color: #111827;
  background: #fff;
  outline: none;
  transition: border-color 150ms ease;
}

.revia-form-group input:focus {
  border-color: #111827;
}

.revia-form-group input::placeholder {
  color: #9ca3af;
}

/* ---- Buttons ---- */
.revia-btn {
  display: block;
  width: 100%;
  padding: 8.75px;
  border: none;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: all 150ms ease;
}

.revia-btn-primary {
  background: #111827;
  color: #fff;
}

.revia-btn-primary:hover {
  background: #1f2937;
}

.revia-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.revia-btn-secondary {
  background: transparent;
  color: #6b7280;
  border: 1px solid #e5e7eb;
}

.revia-btn-secondary:hover {
  color: #374151;
  border-color: #d1d5db;
}

/* ---- Selected tier summary ---- */
.revia-selected-tier {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12.5px;
  background: #f9fafb;
  border-radius: 5px;
  margin-bottom: 15px;
}

.revia-selected-tier-name {
  font-size: 10.625px;
  font-weight: 600;
}

.revia-selected-tier-price {
  font-size: 10.625px;
  font-weight: 600;
}

.revia-selected-tier-price .rm-cadence {
  font-weight: 400;
  color: #6b7280;
}

/* ---- Back link ---- */
.revia-back {
  display: inline-flex;
  align-items: center;
  gap: 2.5px;
  font-size: 9.375px;
  font-weight: 500;
  color: #6b7280;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  margin-bottom: 12.5px;
}

.revia-back:hover {
  color: #374151;
}

/* ---- Error / status messages ---- */
.revia-error {
  background: #fef2f2;
  color: #b91c1c;
  padding: 6.25px 7.5px;
  border-radius: 5px;
  margin-bottom: 10px;
  font-size: 8.125px;
  text-align: center;
}

.revia-info {
  background: #f0fdf4;
  color: #166534;
  padding: 6.25px 7.5px;
  border-radius: 5px;
  margin-bottom: 10px;
  font-size: 8.125px;
  text-align: center;
}

/* ---- OTC code input ---- */
.revia-otc-wrap {
  display: flex;
  gap: 5px;
  justify-content: center;
  margin: 15px 0;
}

.revia-otc-input {
  width: 30px;
  height: 35px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  border: 2px solid #d1d5db;
  border-radius: 5px;
  outline: none;
  color: #111827;
  transition: border-color 150ms ease;
  -moz-appearance: textfield;
}

.revia-otc-input::-webkit-outer-spin-button,
.revia-otc-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.revia-otc-input:focus {
  border-color: #111827;
}

.revia-otc-input.is-filled {
  border-color: #22c55e;
  background: #f0fdf4;
}

.revia-resend {
  display: block;
  margin: 7.5px auto 0;
  background: none;
  border: none;
  color: #6b7280;
  font-size: 8.125px;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}

.revia-resend:hover {
  color: #374151;
}

/* ---- Success state ---- */
.revia-success-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 12.5px;
  background: #ecfdf5;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17.5px;
  color: #22c55e;
}

/* ---- Payment pending ---- */
.revia-spinner {
  width: 25px;
  height: 25px;
  border: 3px solid #e5e7eb;
  border-top-color: #111827;
  border-radius: 50%;
  animation: revia-spin 0.8s linear infinite;
  margin: 0 auto 12.5px;
}

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

/* ---- Loading skeleton for tiers ---- */
.revia-skeleton {
  background: linear-gradient(90deg, #f4f4f5 25%, #e5e7eb 50%, #f4f4f5 75%);
  background-size: 200% 100%;
  animation: revia-shimmer 1.5s ease infinite;
  border-radius: 10px;
  height: 200px;
}

.revia-tiers.is-upgrade-only .revia-skeleton {
  height: 240px;
}

@keyframes revia-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================
   Mobile bottom sheet (< 640px)
   ============================================ */
/* ============================================
   Mobile bottom sheet (< 768px)
   ============================================ */
@media (max-width: 767px) {
  #revia-modal-backdrop.is-visible {
    align-items: flex-end;
    padding: 0;
  }

  #revia-modal {
    max-width: 100% !important;
    max-height: 92vh;
    border-radius: 10px 10px 0 0;
    transform: translateY(100%);
  }

  #revia-modal-backdrop.is-active #revia-modal {
    transform: translateY(0);
  }

  /* Drag handle */
  #revia-modal::before {
    content: '';
    display: block;
    width: 25px;
    height: 2.5px;
    background: #d1d5db;
    border-radius: 2.5px;
    margin: 6.25px auto 0;
  }

  #revia-modal-content {
    padding: 15px 12.5px calc(20px + env(safe-area-inset-bottom, 0px));
  }

  #revia-modal.is-upgrade-only #revia-modal-content {
    padding: 15px 12.5px calc(20px + env(safe-area-inset-bottom, 0px));
  }

  #revia-modal.is-upgrade-only .rm-title {
    font-size: 17.5px;
  }

  #revia-modal-close {
    width: 27.5px;
    height: 27.5px;
    font-size: 15px;
  }

  .revia-back {
    padding: 6.25px 0;
    min-height: 27.5px;
  }

  .revia-cadence-btn {
    padding: 6.25px 12.5px;
  }

  .revia-form-group input {
    font-size: 16px;
  }

  #revia-modal.is-simple-signup #revia-modal-content {
    padding: 30px 15px calc(25px + env(safe-area-inset-bottom, 0px));
  }

  .revia-modal-brand {
    min-height: 54px;
    margin-bottom: 15px;
  }

  .revia-modal-brand img {
    max-width: min(100%, 220px);
    max-height: 54px;
  }

  .revia-simple-signup-copy {
    margin-bottom: 20px;
    font-size: 15.5px;
    line-height: 1.5;
    text-align: center;
  }

  .revia-simple-signup-form {
    align-items: stretch;
    flex-direction: column;
    gap: 6.25px;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
  }

  .revia-simple-signup-form:focus-within {
    box-shadow: none;
  }

  .revia-simple-signup-form input[type="email"] {
    width: 100%;
    height: 56px;
    padding: 0 12px;
    border: 1px solid #d9d9d9;
    background: #fff;
    font-size: 16px;
  }

  .revia-simple-signup-form input[type="email"]:focus {
    border-color: #2dd4bf;
    box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.14);
  }

  .revia-simple-signup-submit {
    width: 100%;
    min-width: 0;
    height: 56px;
    font-size: 10.8px;
  }

  /* Stack tier cards vertically on mobile */
  .revia-tiers {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .revia-tiers.is-upgrade-only {
    grid-template-columns: 1fr;
    max-width: none;
  }

  /* Larger touch targets */
  .revia-tier-card {
    padding: 12.5px;
  }

  .revia-btn, .revia-tier-btn {
    padding: 8.75px;
    font-size: 9.375px;
  }

  .revia-otc-input {
    width: 27.5px;
    height: 32.5px;
    font-size: 13.75px;
  }
}


/* Resume Builder host compatibility */
#revia-modal {
  line-height: 1.6;
}

#revia-modal :where(button, input, select, textarea) {
  line-height: inherit;
}

#revia-modal :where(h1, h2, h3, h4, h5, h6),
#revia-modal .revia-tier-name {
  line-height: 1.2;
}
