/* ────────────────────────────────────────────────────────────────────────────
   tiers.css — Shared tier / plan card design system
   Single source of truth for the plan-card grid used by BOTH pages:
     • /pricing  (public marketing grid — add `tier-grid--marketing` on the grid)
     • /billing  (in-app plan management grid — base look)

   Base styles = compact in-app look (billing). The `.tier-grid--marketing`
   modifier scales cards up and switches to marketing colors so the public
   pricing page keeps its larger, bolder appearance. Keep all tier-card styling
   here — do NOT re-add these rules to the page templates, or the two pages will
   drift apart again.
   ──────────────────────────────────────────────────────────────────────────── */

/* ── Grid ─────────────────────────────────────────────────────────────────── */
.tier-grid {
    display: grid;
    /* Min card width kept small enough that all six cards (Free Trial +
       5 tiers) fit on one row inside the billing card at desktop widths. */
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

/* Marketing (public /pricing) grid: fixed 5-up, collapsing responsively. */
.tier-grid--marketing {
    grid-template-columns: repeat(5, 1fr);
    margin-top: 0;
}

/* ── Card shell ───────────────────────────────────────────────────────────── */
.tier-card {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tier-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.tier-grid--marketing .tier-card {
    padding: 1.75rem;
    gap: 0.75rem;
}

/* ── Card states ──────────────────────────────────────────────────────────── */
/* "current" — the tenant's active/pending plan on /billing. */
.tier-card.current {
    border-color: #0e7a86;
    box-shadow: 0 4px 12px rgba(14, 122, 134, 0.15);
}

/* "free-trial" — the teal trial card (both pages). */
.tier-card.free-trial {
    background: #f0f9ff;
    border-color: #0e7a86;
}
.tier-card.free-trial .tier-price { color: #0e7a86; }

/* Current-plan corner badge (billing). */
.tier-card .tier-badge-current {
    position: absolute;
    top: -10px;
    right: 12px;
    background: #0e7a86;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Name / description ───────────────────────────────────────────────────── */
.tier-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #16201f;
}
.tier-grid--marketing .tier-name {
    font-size: 1.4rem;
    color: #1a1a1a;
}

.tier-description {
    font-size: 0.85rem;
    color: #666;
    min-height: 2.5em;
}

/* ── Price ────────────────────────────────────────────────────────────────── */
.tier-price {
    font-size: 1.6rem;
    font-weight: 800;
    color: #0e7a86;
    line-height: 1;
}
.tier-price small {
    font-size: 0.85rem;
    font-weight: 400;
    color: #666;
}
/* Marketing: bigger, dark price with the unit on its own line. */
.tier-grid--marketing .tier-price {
    font-size: 2.2rem;
    color: #1a1a1a;
}
.tier-grid--marketing .tier-price small {
    display: block;
    margin-top: 0.35rem;
}

/* ── Seat / capacity descriptors ──────────────────────────────────────────── */
/* Compact capacity line (billing). */
.tier-cap {
    font-size: 0.9rem;
    color: #555;
}

/* Marketing seat pill (pricing). */
.tier-seats {
    font-size: 0.9rem;
    color: #333;
    font-weight: 600;
    background: #f3f4f6;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    display: inline-block;
    align-self: flex-start;
}

/* Marketing "From $X/month" minimum (pricing). */
.tier-min {
    font-size: 0.75rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.5rem;
}
.tier-min strong {
    display: block;
    color: #333;
    font-size: 0.9rem;
    text-transform: none;
    letter-spacing: 0;
    margin-top: 0.25rem;
}

/* Seat-usage progress bar (billing status card). */
.seat-bar-wrap { margin-top: 0.5rem; }
.seat-bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 0.35rem;
}
.seat-bar-fill {
    height: 100%;
    background: #0e7a86;
    transition: width 0.3s ease;
}
.seat-bar-fill.full { background: #dc3545; }

/* ── Call-to-action area ──────────────────────────────────────────────────── */
/* Billing action container (forms / seat pickers). */
.tier-action {
    margin-top: auto;
    padding-top: 0.75rem;
}
.tier-action form { margin: 0; }
.tier-action .btn { width: 100%; }

/* Unavailable / informational CTA text (both pages). */
.tier-unavailable {
    display: block;
    font-size: 0.8rem;
    color: #999;
    text-align: center;
    padding: 0.5rem;
}

/* Marketing CTA buttons (pricing — anchor-style buttons). */
.tier-cta {
    margin-top: auto;
    padding-top: 1rem;
}
.tier-cta a {
    display: block;
    width: 100%;
    padding: 0.7rem;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    box-sizing: border-box;
    transition: opacity 0.15s ease, background 0.15s ease;
}
/* All CTA variants use the site teal (matches the header Sign in pill). */
.tier-cta .btn-primary {
    background: #0e7a86;
    color: #fff;
}
.tier-cta .btn-primary:hover { background: #0c6671; }
.tier-cta .btn-secondary {
    background: #fff;
    color: #0e7a86;
    border: 2px solid #0e7a86;
}
.tier-cta .btn-secondary:hover { background: #0e7a86; color: #fff; }
.tier-cta .btn-dark {
    background: #0e7a86;
    color: #fff;
}
.tier-cta .btn-dark:hover { background: #0c6671; }

/* ── Responsive (marketing grid only) ─────────────────────────────────────── */
/* 5-up needs the full --page-max (1200px) container; below that, cards would
   shrink past their minimum readable width, so collapse to 3-up. */
@media (max-width: 1200px) {
    .tier-grid--marketing { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
    .tier-grid--marketing { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .tier-grid--marketing { grid-template-columns: 1fr; }
}
