/* Matches web app index: white bg, gray scale, system UI fonts */

:root {
  --bg: #ffffff;
  --surface: #f9fafb;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --link: #374151;
  --link-hover: #111827;
  --primary: #111827;
  --primary-hover: #1f2937;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --danger-text: #991b1b;
  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;
  --success-text: #166534;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.site-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.site-logo:hover {
  color: var(--link-hover);
}

.site-nav {
  display: flex;
  gap: 1rem 1.25rem;
  flex-wrap: wrap;
  align-items: center;
}

.site-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--link);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--link-hover);
}

.billing-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.billing-subnav a {
  color: var(--link);
  text-decoration: none;
  font-weight: 500;
}

.billing-subnav a:hover {
  color: var(--link-hover);
}

.billing-subnav a.is-active {
  color: var(--text);
  font-weight: 600;
}

.billing-panel[hidden] {
  display: none !important;
}

.wrap {
  flex: 1;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.wrap--narrow {
  max-width: 480px;
}

.wrap--wide {
  max-width: 560px;
}

/* Match /pricing/ exactly: max-w-6xl + px-6 sm:px-8 lg:px-12 */
.wrap--plans {
  max-width: 72rem;
  padding-left: 1.5rem;  /* px-6 */
  padding-right: 1.5rem;
}
@media (min-width: 640px) {
  .wrap--plans {
    padding-left: 2rem;  /* sm:px-8 */
    padding-right: 2rem;
  }
}
@media (min-width: 1024px) {
  .wrap--plans {
    padding-left: 3rem;  /* lg:px-12 */
    padding-right: 3rem;
  }
}

/* Legacy — kept for non-plan grids; the plan grid now uses Tailwind classes directly */
.plan-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  width: 100%;
}

.billing-interval-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 1.5rem;
}

.billing-interval-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.billing-interval-hint {
  font-size: 0.75rem;
  color: var(--muted);
}

/* billing-toggle is now Tailwind-based (matches pricing page) */

.plan-features {
  margin: 0;
  padding-left: 0;
  list-style: none;
  font-size: 0.875rem;
  color: #4b5563;
  line-height: 1.5;
  flex: 1;
}

.plan-features li {
  margin-bottom: 0.35rem;
}

.plan-features li:last-child {
  margin-bottom: 0;
}

.plan-card-tagline {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--muted);
  margin: 0.25rem 0 0;
  line-height: 1.45;
}

.plan-card-includes {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0.5rem 0 0.35rem;
}

.plan-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 100%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.plan-card--starter {
  background: rgba(249, 250, 251, 0.8);
  border-color: var(--border);
}

.plan-card--trial {
  position: relative;
  background: linear-gradient(145deg, rgba(240, 253, 250, 0.9) 0%, rgba(249, 250, 251, 0.95) 100%);
  border-color: #99f6e4;
  box-shadow: 0 1px 3px rgba(13, 148, 136, 0.08);
}

.plan-card-ribbon--soft {
  background: #0f766e;
  color: #f0fdfa;
}

.plan-card.is-current,
#plans [data-plan].is-current {
  outline: 2px solid #111827;
  outline-offset: -2px;
}

.plan-card--featured {
  position: relative;
  border-width: 2px;
  border-color: var(--text);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

.plan-card-ribbon {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--text);
  color: #fff;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  z-index: 1;
}

.plan-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
  line-height: 1.3;
}

.plan-card-title--with-ribbon {
  padding-right: 7.5rem;
}

@media (max-width: 520px) {
  .plan-card-title--with-ribbon {
    padding-right: 0;
  }
}

.plan-card-price {
  font-size: 1.875rem;
  font-weight: 700;
  margin: 0.35rem 0 0;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.plan-per {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
}

.plan-card-desc {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0;
  flex: 1;
  line-height: 1.5;
}

.plan-badge {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--muted);
}

.plan-card-foot {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch;
  margin-top: auto;
  width: 100%;
  padding-top: 0.25rem;
}

.plan-card-btn {
  align-self: stretch;
  width: 100%;
  justify-content: center;
  text-align: center;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 9999px;
}

.plan-card--starter .plan-card-btn {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.plan-card--starter .plan-card-btn:hover:not(:disabled) {
  background: #f9fafb;
}

.plan-card--featured .plan-card-btn {
  background: var(--text);
  color: #fff;
  border: none;
}

.plan-card--featured .plan-card-btn:hover:not(:disabled) {
  background: var(--primary-hover);
}

.plan-card--trial .plan-card-btn {
  background: #0f766e;
  color: #fff;
  border: none;
}

.plan-card--trial .plan-card-btn:hover:not(:disabled) {
  background: #115e59;
}

.plan-card-billed-note {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0 0 0.25rem;
}

.btn-cancel-in-card {
  background: transparent;
  color: var(--danger);
  padding: 0.35rem 0;
  border-radius: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.btn-cancel-in-card:hover:not(:disabled) {
  background: transparent;
  color: var(--danger-text);
}

.site-nav .nav-text-btn {
  background: transparent;
  color: var(--link);
  padding: 0;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0;
}

.site-nav .nav-text-btn:hover:not(:disabled) {
  background: transparent;
  color: var(--link-hover);
  text-decoration: underline;
}

h1 {
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.sub {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.nav {
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.nav a {
  color: var(--link);
  text-decoration: none;
  font-weight: 500;
}

.nav a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.card h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 1rem;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--link);
  margin-bottom: 0.35rem;
}

input[type="email"],
input[type="password"],
input[type="text"],
textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
}

textarea {
  min-height: 72px;
  resize: vertical;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 1px var(--text);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.75rem;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 9999px;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--primary);
  color: #fff;
  transition: background 0.15s ease;
}

button:hover:not(:disabled) {
  background: var(--primary-hover);
}

button.secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 0.5rem;
}

button.secondary:hover:not(:disabled) {
  background: #f9fafb;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Billing tabs: override global button (dark pill hover would hide dark link text) */
.billing-subnav.billing-tabs button.billing-tab {
  background: transparent;
  border: none;
  border-radius: 0;
  cursor: pointer;
  font: inherit;
  padding: 0;
  color: var(--link);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
}

.billing-subnav.billing-tabs button.billing-tab:hover:not(:disabled) {
  background: transparent;
  color: var(--muted);
}

.billing-subnav.billing-tabs button.billing-tab:focus-visible {
  background: transparent;
  color: var(--muted);
  outline: 2px solid var(--border-strong);
  outline-offset: 2px;
}

.billing-subnav.billing-tabs button.billing-tab.is-active {
  color: var(--text);
  font-weight: 600;
}

.billing-subnav.billing-tabs button.billing-tab.is-active:hover:not(:disabled) {
  background: transparent;
  color: var(--muted);
}

.msg {
  font-size: 0.875rem;
  margin-top: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.5rem;
}

.msg.ok {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
}

.msg.err {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
}

.hint {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0.75rem 0 0;
}

.hint a {
  color: var(--link);
  font-weight: 500;
  text-decoration: none;
}

.hint a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.stat {
  font-size: 1.05rem;
}

.stat strong {
  color: var(--text);
  font-weight: 600;
}

.inline-link {
  color: var(--link);
  font-weight: 500;
  text-decoration: underline;
}

.inline-link:hover {
  color: var(--link-hover);
}

.site-footer {
  margin-top: auto;
  background: #111827;
  color: #d1d5db;
  padding: 2.5rem 1.5rem;
  font-size: 0.875rem;
}

.site-footer-inner {
  max-width: 80rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
}

@media (min-width: 768px) {
  .site-footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.site-footer a {
  color: #d1d5db;
  text-decoration: none;
}

.site-footer a:hover {
  color: #fff;
}

code {
  font-size: 0.8125rem;
  word-break: break-all;
  background: #f3f4f6;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

footer.page-footer {
  margin-top: 2rem;
  font-size: 0.75rem;
  color: var(--muted);
}
