/*
Theme Name:  Store Plans
Description: Minimal grayscale subscription pricing theme for WooCommerce
Version:     1.0.0
Author:      Store Plans
Text Domain: store-plans
Requires at least: 6.0
Requires PHP: 7.4
*/

/* ── CSS Custom Properties ──────────────────────────────────────────────── */
:root {
  --c-bg:        #f7f7f7;
  --c-surface:   #ffffff;
  --c-border:    #e2e2e2;
  --c-text:      #111111;
  --c-muted:     #555555;
  --c-subtle:    #999999;
  --c-accent:    #111111;
  --c-accent-fg: #ffffff;
  --c-divider:   #ececec;
  --c-featured:  #111111;

  --r-card: 10px;
  --r-btn:   6px;
  --gap:     1.5rem;
  --max-w:  1140px;
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  background: var(--c-bg);
  color: var(--c-text);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ── Site Header ────────────────────────────────────────────────────────── */
.site-header {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-divider);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: .9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-header__name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--c-text);
}
.site-header__cart {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .85rem;
  color: var(--c-muted);
  transition: color .15s;
}
.site-header__cart:hover { color: var(--c-text); }
.site-header__cart svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.site-header__cart-count {
  background: var(--c-text);
  color: var(--c-accent-fg);
  font-size: .7rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  line-height: 1.4;
}

/* ── Hero ───────────────────────────────────────────────────────────────── */
.pricing-hero {
  text-align: center;
  padding: 4.5rem 1.5rem 3rem;
}
.pricing-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.15;
  color: var(--c-text);
}
.pricing-hero p {
  margin-top: .75rem;
  color: var(--c-muted);
  font-size: 1.05rem;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Plans Grid ─────────────────────────────────────────────────────────── */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: var(--gap);
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem 6rem;
  align-items: start;
}

/* ── Plan Card ──────────────────────────────────────────────────────────── */
.plan-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  transition: box-shadow .18s, border-color .18s;
}
.plan-card:hover {
  border-color: #bbb;
  box-shadow: 0 4px 24px rgba(0,0,0,.07);
}
.plan-card--featured {
  border-color: var(--c-featured);
  border-width: 2px;
  box-shadow: 0 2px 16px rgba(0,0,0,.08);
}

.plan-card__badge {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--c-surface);
  background: var(--c-text);
  padding: 2px 8px;
  border-radius: 4px;
  align-self: flex-start;
}

.plan-card__name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--c-text);
  line-height: 1.2;
}
.plan-card__users {
  font-size: .85rem;
  color: var(--c-muted);
  margin-top: .2rem;
}

.plan-card__price {
  display: flex;
  align-items: baseline;
  gap: .2rem;
}
.plan-card__currency {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--c-muted);
  align-self: flex-start;
  margin-top: .45rem;
}
.plan-card__amount {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -.04em;
  color: var(--c-text);
  line-height: 1;
}
.plan-card__period {
  font-size: .82rem;
  color: var(--c-muted);
  align-self: flex-end;
  margin-bottom: .1rem;
}

.plan-card__divider {
  border: none;
  border-top: 1px solid var(--c-divider);
  margin: 0;
}

.plan-card__trial {
  font-size: .8rem;
  color: var(--c-subtle);
}

/* ── CTA Button ─────────────────────────────────────────────────────────── */
.btn-subscribe {
  display: block;
  width: 100%;
  padding: .7rem 1rem;
  background: var(--c-accent);
  color: var(--c-accent-fg);
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .01em;
  border: 2px solid var(--c-accent);
  border-radius: var(--r-btn);
  cursor: pointer;
  text-align: center;
  transition: background .15s, color .15s;
  margin-top: auto;
}
.btn-subscribe:hover {
  background: #333;
  border-color: #333;
}
.plan-card--featured .btn-subscribe {
  background: var(--c-accent);
  color: var(--c-accent-fg);
}

/* ── WooCommerce Notices ─────────────────────────────────────────────────── */
.woocommerce-notices-wrapper,
.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
  max-width: var(--max-w);
  margin: 1.5rem auto;
  padding: 0 1.5rem;
}
.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
  list-style: none;
  padding: .85rem 1.25rem;
  border-radius: var(--r-card);
  font-size: .9rem;
}
.woocommerce-message { background: #f0f0f0; border-left: 3px solid #555; }
.woocommerce-error   { background: #fafafa; border-left: 3px solid #111; }
.woocommerce-info    { background: #f5f5f5; border-left: 3px solid #888; }

/* ── Page / Checkout Wrapper ────────────────────────────────────────────── */
.page-content-wrap {
  max-width: 800px;
  margin: 2.5rem auto;
  padding: 0 1.5rem 5rem;
}

/* ── WooCommerce Checkout & Cart Forms ──────────────────────────────────── */
.woocommerce h2,
.woocommerce h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--c-text);
}
.woocommerce form .form-row {
  margin-bottom: 1rem;
}
.woocommerce form .form-row label {
  font-size: .85rem;
  color: var(--c-muted);
  margin-bottom: .3rem;
  display: block;
  font-weight: 500;
}
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row select,
.woocommerce form .form-row textarea {
  width: 100%;
  border: 1px solid var(--c-border);
  border-radius: 5px;
  padding: .6rem .85rem;
  font-size: .95rem;
  background: var(--c-surface);
  color: var(--c-text);
  font-family: inherit;
  transition: border-color .15s;
  outline: none;
}
.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row select:focus {
  border-color: var(--c-text);
}

/* Order review table */
.woocommerce-checkout-review-order-table,
.woocommerce-table--order-details {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  margin-bottom: 1.5rem;
}
.woocommerce-checkout-review-order-table th,
.woocommerce-checkout-review-order-table td,
.woocommerce-table--order-details th,
.woocommerce-table--order-details td {
  padding: .6rem .5rem;
  border-bottom: 1px solid var(--c-divider);
  text-align: left;
}
.woocommerce-checkout-review-order-table tfoot td,
.woocommerce-checkout-review-order-table tfoot th {
  font-weight: 700;
}

/* Place order button */
#place_order {
  display: block;
  width: 100%;
  padding: .9rem;
  background: var(--c-accent);
  color: var(--c-accent-fg);
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--r-btn);
  cursor: pointer;
  margin-top: 1.5rem;
  font-family: inherit;
  letter-spacing: .01em;
  transition: background .15s;
}
#place_order:hover { background: #333; }

/* Stripe card element */
#wc-stripe-card-element,
#wc-stripe-payment-element {
  border: 1px solid var(--c-border);
  border-radius: 5px;
  padding: .7rem .85rem;
  background: var(--c-surface);
}

/* ── Site Footer ────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--c-divider);
  background: var(--c-surface);
  padding: 1.5rem;
  text-align: center;
  font-size: .8rem;
  color: var(--c-subtle);
}

/* ── Two-plan grid variant ──────────────────────────────────────────────── */
.plans-grid--two {
  grid-template-columns: repeat(2, minmax(0, 420px));
  justify-content: center;
}

/* ── Seat selector ──────────────────────────────────────────────────────── */
.plan-card__seats label {
  font-size: .8rem;
  color: var(--c-muted);
  display: block;
  margin-bottom: .4rem;
}
.seat-control {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.seat-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--c-border);
  border-radius: 4px;
  background: var(--c-surface);
  color: var(--c-text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s;
}
.seat-btn:hover:not(:disabled) { border-color: var(--c-text); }
.seat-btn:disabled { opacity: .35; cursor: not-allowed; }
.seat-count {
  font-size: 1.1rem;
  font-weight: 700;
  min-width: 28px;
  text-align: center;
}
.plan-card__total {
  margin-top: .6rem;
  font-size: .9rem;
  color: var(--c-muted);
  font-weight: 500;
}
.plan-card__total .total-price { font-weight: 700; color: var(--c-text); }

/* ── Plan features list ─────────────────────────────────────────────────── */
.plan-card__features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  font-size: .875rem;
  color: var(--c-muted);
}
.plan-card__features li::before {
  content: "✓ ";
  color: var(--c-text);
  font-weight: 700;
}

/* ── Workspace URL field (checkout) ─────────────────────────────────────── */
.workspace-field {
  margin: 1.5rem 0;
  padding: 1.25rem;
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  background: var(--c-bg);
}
.workspace-field > label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: .6rem;
}
.workspace-input-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.workspace-input-row input[type="text"] {
  flex: 1;
  min-width: 140px;
  border: 1px solid var(--c-border);
  border-radius: 5px;
  padding: .55rem .8rem;
  font-size: .95rem;
  font-family: inherit;
  background: var(--c-surface);
  color: var(--c-text);
  outline: none;
  transition: border-color .15s;
}
.workspace-input-row input[type="text"]:focus { border-color: var(--c-text); }
.workspace-suffix {
  font-size: .9rem;
  color: var(--c-muted);
  white-space: nowrap;
}
.btn-check-avail {
  padding: .5rem .9rem;
  font-size: .85rem;
  font-weight: 600;
  border: 1px solid var(--c-border);
  border-radius: 5px;
  background: var(--c-surface);
  color: var(--c-text);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  white-space: nowrap;
  font-family: inherit;
}
.btn-check-avail:hover { border-color: var(--c-text); }
#workspace-status { margin-top: .5rem; font-size: .85rem; min-height: 1.2em; }
.ws-available { color: #2a7a2a; font-weight: 600; }
.ws-taken     { color: #b00; font-weight: 600; }
.ws-error     { color: #888; }
.ws-checking  { color: var(--c-muted); }

/* ── Onboarding: 3-screen flow ──────────────────────────────────────────── */
.ob-wrap {
  max-width: 820px;
  margin: 3rem auto;
  padding: 0 1.5rem 5rem;
}
.ob-screen { display: none; }
.ob-screen.active { display: block; animation: obFadeIn .25s ease; }
@keyframes obFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Screen 1 */
.ob-welcome {
  text-align: center;
  padding: 4rem 1rem;
}
.ob-welcome h1 { font-size: clamp(1.6rem, 3.5vw, 2.5rem); font-weight: 800; letter-spacing: -.03em; }
.ob-welcome p  { margin: 1rem auto; color: var(--c-muted); max-width: 480px; font-size: 1.05rem; }

/* Screen 2 */
.ob-form-wrap { max-width: 440px; margin: 0 auto; }
.ob-form-wrap h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: .5rem; }
.ob-form-wrap p  { color: var(--c-muted); margin-bottom: 2rem; }
.ob-field { margin-bottom: 1.1rem; }
.ob-field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .3rem; color: var(--c-muted); }
.ob-field input {
  width: 100%;
  border: 1px solid var(--c-border);
  border-radius: 5px;
  padding: .65rem .9rem;
  font-size: 1rem;
  font-family: inherit;
  background: var(--c-surface);
  color: var(--c-text);
  outline: none;
  transition: border-color .15s;
}
.ob-field input:focus { border-color: var(--c-text); }

/* Screen 3 */
.ob-screen-3-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2rem;
}
.ob-checklist { list-style: none; display: flex; flex-direction: column; gap: .75rem; margin-top: 1.5rem; }
.ob-checklist li {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .95rem;
  color: var(--c-muted);
}
.ob-checklist li::before {
  content: "⌛";
  font-size: 1rem;
  flex-shrink: 0;
}
.ob-checklist li.done { color: var(--c-text); font-weight: 600; }
.ob-checklist li.done::before { content: "✅"; }

.ob-right h3 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.ob-right-option {
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  padding: 1rem 1.25rem;
  margin-bottom: .75rem;
  cursor: pointer;
  transition: border-color .15s;
}
.ob-right-option:hover { border-color: #aaa; }
.ob-right-option label { font-size: .9rem; font-weight: 600; display: block; cursor: pointer; }
.ob-right-option p { font-size: .8rem; color: var(--c-muted); margin-top: .2rem; }
.ob-right-option input[type="file"],
.ob-right-option textarea {
  width: 100%;
  margin-top: .6rem;
  font-family: inherit;
  font-size: .85rem;
  border: 1px solid var(--c-border);
  border-radius: 4px;
  padding: .4rem .6rem;
}
.ob-right-option textarea { resize: vertical; min-height: 70px; }

/* Shared button (overrides .btn-subscribe for onboarding) */
.btn-ob {
  display: inline-block;
  padding: .8rem 2rem;
  background: var(--c-accent);
  color: var(--c-accent-fg);
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--r-btn);
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, opacity .15s;
  letter-spacing: .01em;
}
.btn-ob:hover    { background: #333; }
.btn-ob:disabled { opacity: .4; cursor: not-allowed; background: var(--c-accent); }
.btn-ob--full    { display: block; width: 100%; text-align: center; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .plans-grid,
  .plans-grid--two {
    grid-template-columns: 1fr;
    padding-bottom: 4rem;
  }
  .ob-screen-3-inner { grid-template-columns: 1fr; }
  .pricing-hero { padding: 3rem 1.25rem 2rem; }
  .plan-card__amount { font-size: 2rem; }
}
