/* ================================ */
/* MolMin — Pricing Tiers           */
/* Google AI Plans–inspired layout  */
/* Requires: base.css, auth.css     */
/* ================================ */

.tier-page { padding-top: calc(var(--nav-h) + 3.5rem); padding-bottom: 4rem; }

.tier-header { text-align: center; margin-bottom: 3.5rem; }
.tier-title { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 0.8rem; }

/* ── Cards grid ── */
.tier-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1.4rem; margin: 0 auto; padding: 0 2rem;
  align-items: stretch;
}

/* ── Card — Google-style dark rounded rectangles with glow border ── */
.tier-card {
  position: relative; display: flex; flex-direction: column; align-items: center;
  text-align: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem 1.5rem 1.8rem;
  transition: border-color 0.4s, box-shadow 0.4s, transform 0.35s;
  overflow: hidden;
}

/* Glow border overlay */
.tier-card::before {
  content: ''; position: absolute; inset: -1px; border-radius: 20px;
  background: linear-gradient(160deg, rgba(99,102,241,0.22), rgba(139,92,246,0.1), rgba(99,102,241,0.18));
  opacity: 0; transition: opacity 0.4s; z-index: 0; pointer-events: none;
}

.tier-card:hover {
  border-color: rgba(99,102,241,0.45);
  box-shadow: 0 0 36px rgba(99,102,241,0.1), 0 8px 32px rgba(0,0,0,0.18);
  transform: translateY(-4px);
}
.tier-card:hover::before { opacity: 1; }

.tier-card > * { position: relative; z-index: 1; }

/* Featured card — always-on glow */
.tier-card.featured { border-color: rgba(99,102,241,0.4); box-shadow: 0 0 28px rgba(99,102,241,0.08); }
.tier-card.featured::before { opacity: 1; }

/* ── Plan name (gradient text like Google's blue title) ── */
.tier-plan-name {
  font-size: 1.45rem; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--accent) 0%, #a78bfa 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* ── Description ── */
.tier-desc {
  font-size: 0.88rem; line-height: 1.6; color: var(--text-secondary);
  margin-bottom: 1.5rem; min-height: 3.2em;
}

/* ── Highlight stat row (e.g. "10 req / day") ── */
.tier-highlight { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 0.15rem; }
.tier-highlight-sub { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 1.4rem; }

/* ── Price ── */
.tier-price-row {
  margin-bottom: 1.5rem; min-height: 2.6em;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.tier-price-val { font-size: 1.2rem; font-weight: 700; font-family: var(--mono); letter-spacing: -0.02em; }

/* ── CTA (pill button like Google) ── */
.tier-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.68rem 1.8rem; border-radius: 999px;
  font-family: var(--font); font-size: 0.88rem; font-weight: 600;
  cursor: pointer; transition: all 0.25s; text-decoration: none; border: none;
  margin-bottom: 2rem;
}
.tier-cta svg { width: 16px; height: 16px; transition: transform 0.2s; }
.tier-cta:hover svg { transform: translateX(3px); }

.tier-cta.outline { background: none; border: 1px solid var(--border); color: var(--text-primary); }
.tier-cta.outline:hover { border-color: var(--accent); color: var(--accent); background: rgba(99,102,241,0.04); }

/* ── "Includes X access to:" ── */
.tier-includes-label {
  font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 1rem; width: 100%;
}
.tier-includes-label em { font-style: italic; color: var(--text-primary); font-weight: 600; }

/* ── Feature icons row (Google style) ── */
.tier-features-row {
  display: flex; justify-content: center; gap: 0.9rem 0.6rem; flex-wrap: wrap;
  width: 100%; margin-bottom: 1.2rem;
}

.tier-feat { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; flex: 0 0 calc(33.333% - 0.4rem); min-width: 0; }
.tier-feat-icon { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; color: var(--accent); }
.tier-feat-label { font-size: 0.68rem; color: var(--text-muted); text-align: center; line-height: 1.3; }
.tier-feat.muted { opacity: 0.25; }

/* ── "View plan benefits" link ── */
.tier-benefits-link {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.82rem; font-weight: 500; color: var(--accent); text-decoration: none; transition: opacity 0.2s;
}
.tier-benefits-link:hover { opacity: 0.7; }
.tier-benefits-link svg { width: 16px; height: 16px; }

/* ── Compare plans button ── */
.tier-compare-wrap { display: flex; justify-content: center; margin-top: 3.5rem; position: relative; z-index: 10; }
.tier-compare-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.7rem 2.2rem; border-radius: 999px;
  background: none; border: 1px solid var(--border); color: var(--text-primary);
  font-family: var(--font); font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: all 0.25s; text-decoration: none; position: relative; z-index: 10;
}
.tier-compare-btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(99,102,241,0.04); }

/* ── Stagger entrance ── */
@keyframes tierCardIn { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: translateY(0); } }
.tier-card { animation: tierCardIn 0.55s ease-out both; }
.tier-card:nth-child(1) { animation-delay: 0.06s; }
.tier-card:nth-child(2) { animation-delay: 0.14s; }
.tier-card:nth-child(3) { animation-delay: 0.22s; }
.tier-card:nth-child(4) { animation-delay: 0.30s; }

/* ── Responsive ── */
@media (max-width: 960px) { .tier-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) {
  .tier-grid { grid-template-columns: 1fr; max-width: 380px; padding: 0 1rem; }
  .tier-title { font-size: 1.9rem; }
  .tier-card { padding: 2rem 1.3rem 1.5rem; }
}

/* ── Light mode ── */
[data-theme="light"] .tier-card { box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
[data-theme="light"] .tier-card::before { background: linear-gradient(160deg, rgba(0,122,255,0.1), rgba(88,86,214,0.05), rgba(0,122,255,0.08)); }
[data-theme="light"] .tier-card:hover { border-color: rgba(0,122,255,0.3); box-shadow: 0 4px 20px rgba(0,0,0,0.06); }
[data-theme="light"] .tier-card.featured { border-color: rgba(0,122,255,0.25); box-shadow: 0 2px 16px rgba(0,122,255,0.06); }
[data-theme="light"] .tier-plan-name { background: linear-gradient(135deg, #007aff, #5856d6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
[data-theme="light"] .tier-cta.outline:hover { border-color: #007aff; color: #007aff; background: rgba(0,122,255,0.03); }
[data-theme="light"] .tier-feat-icon { color: #007aff; }
[data-theme="light"] .tier-benefits-link { color: #007aff; }
[data-theme="light"] .tier-compare-btn:hover { border-color: #007aff; color: #007aff; background: rgba(0,122,255,0.03); }

/* ── Compare table — Apple Design Language ── */
.tier-compare-table-wrap {
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height 0.6s cubic-bezier(0.4,0,0.2,1), opacity 0.5s ease, margin 0.5s ease;
  margin: 0 2rem; position: relative; z-index: 10;
}
.tier-compare-table-wrap.open {
  max-height: 1600px; opacity: 1; margin-top: 3rem;
}

.tier-compare-title {
  font-size: 2rem; font-weight: 700; text-align: center; margin-bottom: 0.3rem;
  letter-spacing: -0.025em; line-height: 1.2;
}
.tier-compare-sub {
  font-size: 1rem; color: var(--text-muted); text-align: center; margin-bottom: 2.5rem;
  font-weight: 400;
}

.tier-compare-chevron { transition: transform 0.3s; flex-shrink: 0; }
.tier-compare-btn.open .tier-compare-chevron { transform: rotate(180deg); }

.tier-compare-tbl {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: transparent;
}

/* ── Header row ── */
.tier-compare-tbl thead th {
  padding: 0 1.5rem 1.5rem; text-align: center; vertical-align: bottom;
  background: transparent; border: none;
  border-bottom: 1px solid var(--border);
}
.tier-compare-tbl thead th:first-child { text-align: left; }

.tbl-plan-name {
  display: block; font-size: 1.15rem; font-weight: 600; color: var(--text-primary);
  letter-spacing: -0.01em; margin-bottom: 0.25rem;
}
.tbl-plan-price {
  display: block; font-size: 0.82rem; font-weight: 400; color: var(--text-muted);
}

/* ── Body cells ── */
.tier-compare-tbl tbody td {
  padding: 1rem 1.5rem; font-size: 0.92rem; color: var(--text-secondary);
  border-bottom: 1px solid var(--border); text-align: center; vertical-align: middle;
  background: transparent; transition: background 0.2s;
}
.tier-compare-tbl tbody tr:last-child td { border-bottom: none; }
.tier-compare-tbl tbody tr:hover:not(.tbl-category-row) td { background: rgba(99,102,241,0.03); }

.tier-tbl-feature {
  text-align: left !important; font-weight: 500; color: var(--text-primary);
  white-space: nowrap; letter-spacing: -0.005em;
}

/* ── Category rows — minimal, Apple-style section dividers ── */
.tbl-category-row td {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); padding: 2rem 1.5rem 0.6rem !important;
  border-bottom: 1px solid var(--border); background: transparent;
}

/* ── Value styling ── */
.tbl-highlight { color: var(--accent); font-weight: 600; }

.tbl-check { color: var(--green); opacity: 0.85; }
.tbl-dash { color: var(--text-muted); opacity: 0.25; font-weight: 300; font-size: 1.2rem; }

/* ── Responsive ── */
@media (max-width: 700px) {
  .tier-compare-table-wrap { margin: 0 1rem; }
  .tier-compare-tbl thead th, .tier-compare-tbl tbody td { padding: 0.75rem 0.8rem; font-size: 0.82rem; }
  .tbl-plan-name { font-size: 0.95rem; }
  .tier-compare-title { font-size: 1.5rem; }
}
@media (max-width: 500px) {
  .tier-compare-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0.5rem; }
  .tier-compare-tbl { min-width: 580px; }
}

/* ── Light mode refinements ── */
[data-theme="light"] .tbl-check { color: #34c759; opacity: 0.9; }
[data-theme="light"] .tbl-highlight { color: var(--accent); }
[data-theme="light"] .tier-compare-tbl tbody tr:hover:not(.tbl-category-row) td { background: rgba(0,122,255,0.02); }
[data-theme="light"] .tbl-category-row td { color: var(--text-muted); }
