/* pages/pricing.css
   Split from the original monolithic styles.css.
   Rules kept in original source order to preserve the cascade.
   48 rules. */

.license-modal-content {
    background: var(--ink-800);
    margin: auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 850px;
    position: relative;
    box-shadow: 0 15px 50px rgba(0,0,0,0.25);
    animation: slideInUp 0.4s ease;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.close-modal-btn {
    position: absolute;
    top: 18px;
    right: 22px;
    color: var(--text-mid);
    font-size: 2rem;
    line-height: 1;
    font-weight: bold;
    border: none;
    background: none;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.2s ease;
    z-index: 10;
}

.close-modal-btn:hover {
    color: var(--text-hi);
    transform: scale(1.1);
}

#checkout-view {
    display: flex;
    flex-direction: row;
    width: 100%;
}

.checkout-details-column {
    background-color: var(--ink-850);
    padding: 2.5rem;
    width: 45%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid var(--line);
}

.checkout-details-column h2 {
    font-size: 2.2rem;
    color: var(--text-hi);
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.checkout-details-column p {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--gold);
    margin: 0;
}

#membership-checkout-form {
    padding: 2.5rem;
    width: 55%;
    display: flex;
    flex-direction: column;
}

#checkout-error-message {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

#membership-checkout-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-mid);
}

#membership-checkout-form input[type="email"],
#membership-checkout-form input[type="text"] {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#membership-checkout-form input[type="email"]:read-only {
    background-color: var(--ink-700);
    cursor: not-allowed;
}

#membership-checkout-form input[type="email"]:focus,
#membership-checkout-form input[type="text"]:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(240, 172, 63, 0.2);
}

#terms-agree {
    width: 1.25em;
    height: 1.25em;
    margin-right: 0.75rem;
    accent-color: var(--gold);
    cursor: pointer;
}

#terms-label {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-mid);
}

@media (max-width: 768px) {
    .license-modal-content {
        padding: 0;
        max-height: 90vh;
    }

    #checkout-view {
        flex-direction: column;
    }

    .checkout-details-column,
    #membership-checkout-form {
        width: 100%;
        padding: 1.5rem;
    }

    .checkout-details-column {
        text-align: center;
        border-right: none;
        border-bottom: 1px solid var(--line);
    }

    .checkout-details-column h2 {
        font-size: 1.8rem;
    }

    .checkout-details-column p {
        font-size: 1.2rem;
    }

    #membership-checkout-form {
        padding-top: 2rem;
    }

}

.close-modal-btn:hover {
    color: var(--text-hi);
}

.pricing-explanation {
    padding: 4rem 0;
    background-color: var(--ink-800);
}

.explanation-box {
    background-color: var(--ink-850);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    border: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.explanation-icon {
    font-size: 2.5rem;
    color: var(--gold);
    margin-bottom: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ink-800);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(4, 8, 18, 0.45);
}

.explanation-box h2 {
    font-size: 1.5rem;
    color: var(--text-hi);
    margin-bottom: 1rem;
}

.explanation-box p {
    color: var(--text-mid);
    line-height: 1.7;
}

.pricing-tiers {
    padding: 5rem 0;
}

.pricing-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.toggle-label {
    font-weight: 500;
    color: var(--text-mid);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    align-items: stretch;
}

.pricing-card {
    background: var(--ink-800);
    border-radius: 15px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 30px rgba(4, 8, 18, 0.45);
    border: 1px solid var(--line);
    transition: all 0.3s ease;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.1);
}

.pricing-card[data-tier="pro"] {
    border-color: var(--gold);
    position: relative;
}

.pricing-card[data-tier="pro"]::before {
    content: 'Most Popular';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gold);
    color: var(--text-hi);
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.pricing-card-header {
    text-align: center;
    border-bottom: 1px solid var(--line);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.pricing-card-header h3 {
    font-size: 1.75rem;
    color: var(--text-hi);
    margin: 0 0 0.5rem;
}

.pricing-card-header .purpose {
    color: var(--text-mid);
    font-size: 0.9rem;
    min-height: 40px;
}

.pricing-card-price {
    text-align: center;
    margin-bottom: 2rem;
}

.price-amount {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-hi);
}

.price-period {
    color: var(--text-mid);
    font-size: 1rem;
}

.price-billing-info {
    font-size: 0.85rem;
    color: var(--text-mid);
    margin-top: 0.5rem;
    min-height: 2em;
}

.pricing-card-body {
    flex-grow: 1;
}

.pricing-card-body ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pricing-card-body li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: var(--text-mid);
    line-height: 1.6;
}

.pricing-card-body li i {
    color: var(--success-color);
    margin-top: 5px;
}

.pricing-card-footer {
    margin-top: 2rem;
    text-align: center;
}

/* ---- moved inline from pricing.php ---- */
#view-terms-link {
    text-decoration: underline;
    color: var(--gold);
    font-weight: 500;
    cursor: pointer;
}
#view-terms-link:hover {
    text-decoration: none;
}
#terms-modal #terms-modal-title {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid var(--line);
    margin: 0;
}
#terms-modal .terms-modal-body {
    max-height: 70vh;
    overflow-y: auto;
    line-height: 1.6;
    margin-top: 1rem;
    padding: 0.5rem 1.5rem 1.5rem 1.5rem; /* Added padding */
}
#terms-modal .terms-modal-body h2 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    /* Removed border-bottom from here */
}
#terms-modal .terms-modal-body h2:not(:first-of-type) {
    border-top: 1px solid var(--line);
    padding-top: 1.5rem;
}
#terms-modal .terms-modal-body h3 {
    font-size: 1.2rem;
    margin-top: 1.2rem;
    margin-bottom: 0.5rem;
}
.license-modal .loader {
    margin: 2rem auto;
}

/* ======================================================================
   PRICING — implementation of Pricing.dc.html (Claude Design project).
   Appended last to win the cascade over the legacy rules above.

   This is a LIGHT page: paper background, dark header, and a dark inset
   panel for the memberships block.
   ====================================================================== */

/* No body override: the fixed-nav offset paints the body background,
   and paper there showed as a white stripe above the dark header.
   body stays --ink-950, which matches the header gradient exactly. */
.pricing-page {
    background: var(--paper);
    padding-top: 0;   /* body already offsets the fixed nav */
    color: var(--paper-text);
    /* covers the viewport so a dark body edge can't show below the content
       on browsers where the :has() rule above doesn't apply */
    min-height: 100vh;
}

/* ---------------- header ---------------- */
.pricing-page .pricing-header {
    background: linear-gradient(180deg, #060D1F 0%, #0A1733 100%);
    color: var(--text-hi);
    /* design: 170px top / 90px bottom, minus the 72px body already offsets */
    padding: 98px 0 90px;
    text-align: left;
}
.pricing-page .pricing-header .kicker { display: block; margin-bottom: 22px; }
.pricing-page .pricing-header h1 {
    font-size: clamp(44px, 5.5vw, 76px);
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1.05;
    margin: 0 0 18px;
    color: var(--text-hi);
}
.pricing-page .pricing-header p {
    font-size: 17px;
    line-height: 1.6;
    color: var(--text-mid);
    max-width: 54ch;
    margin: 0;
}

/* ---------------- free-with-credit panel ----------------
   Ported from the design: a dark inset panel at the top of the licence
   section, so the free route is the first thing read on the page. */
.pricing-page .free-panel {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 40px;
    align-items: center;
    background: var(--ink-850);
    color: var(--text-hi);
    padding: 44px 48px;
    margin-bottom: 72px;
}
.pricing-page .free-panel .kicker {
    display: block;
    color: var(--gold);
    letter-spacing: 0.28em;
    margin-bottom: 14px;
}
.pricing-page .free-panel h2 {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: clamp(26px, 3vw, 36px);
    line-height: 1.2;
    letter-spacing: 0;
    margin: 0 0 14px;
    color: var(--text-hi);
}
.pricing-page .free-panel h2 em { color: var(--gold); }
.pricing-page .free-panel p {
    font-size: 15px;
    line-height: 1.65;
    color: var(--text-mid);
    margin: 0;
}
.pricing-page .free-panel-points {
    list-style: none;
    margin: 0;
    padding: 0 0 0 40px;
    border-left: 1px solid rgba(255, 255, 255, 0.14);
    display: flex;
    flex-direction: column;
    gap: 14px;
    font-size: 14px;
    color: var(--text-mid);
}
.pricing-page .free-panel-points li {
    display: flex;
    gap: 10px;
    align-items: baseline;
}
.pricing-page .free-panel-points .mark { color: var(--gold); flex-shrink: 0; }
.pricing-page .free-panel-points .mark.is-no { color: var(--danger); }

@media (max-width: 860px) {
    .pricing-page .free-panel {
        grid-template-columns: 1fr;
        gap: 28px;
        padding: 32px 24px;
        margin-bottom: 48px;
    }
    .pricing-page .free-panel-points {
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.14);
        padding: 24px 0 0;
    }
}

/* ---------------- section heads ---------------- */
.pricing-page .section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 56px;
}
.pricing-page .section-head h2 {
    font-size: clamp(30px, 3.6vw, 44px);
    font-weight: 500;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--paper-text);
}
.pricing-page .section-aside { font-size: 15px; color: var(--paper-low); }

/* ---------------- single-track licences ---------------- */
.pricing-page .licenses-section { padding: 100px 0; }

.pricing-page .license-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}
.pricing-page .license-card {
    /* --span is set inline per card: 2 + 2 + 2, then 3 + 3 */
    grid-column: span var(--span, 2);
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 400px;
    padding: 38px 30px;
    box-sizing: border-box;
    background: var(--paper-card);
    color: var(--paper-text);
    border: 1px solid #DDE3EE;
    border-radius: 0;
    transition: transform 0.25s var(--ease);
}
.pricing-page .license-card:hover { transform: translateY(-6px); }

/* the emphasised card inverts to ink */
.pricing-page .license-card.is-dark {
    background: var(--ink-850);
    color: var(--text-hi);
    border-color: var(--ink-850);
}

.pricing-page .license-tagline { margin-bottom: 26px; color: var(--text-low); }
.pricing-page .license-card.is-dark .license-tagline { color: var(--text-low); }

.pricing-page .license-card h3 {
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0 0 8px;
    color: inherit;
}
.pricing-page .license-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 26px;
}
.pricing-page .license-price .amount {
    font-family: var(--font-serif);
    font-size: 56px;
    line-height: 1;
}
.pricing-page .license-price .per { font-size: 14px; color: var(--text-low); }

.pricing-page .license-desc {
    font-size: 15px;
    line-height: 1.65;
    color: var(--paper-mid);
    margin: 0 0 22px;
    flex: 1;
}
.pricing-page .license-card.is-dark .license-desc { color: var(--text-mid); }

.pricing-page .license-points {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 14.5px;
    margin: 0 0 34px;
    padding: 0;
}
.pricing-page .license-points li { display: flex; gap: 12px; align-items: baseline; }
.pricing-page .license-points li > span:first-child { color: var(--serif-accent); }
.pricing-page .license-card.is-dark .license-points li > span:first-child { color: var(--gold); }

.pricing-page .license-cta {
    display: block;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    padding: 14px 0;
    border-radius: 999px;
    background: transparent;
    color: var(--paper-text);
    border: 1px solid var(--paper-text);
    transition: opacity 0.2s;
}
.pricing-page .license-cta:hover { opacity: 0.85; color: var(--paper-text); }
.pricing-page .license-card.is-dark .license-cta {
    background: var(--paper);
    color: var(--ink-950);
    border-color: var(--paper);
}
.pricing-page .license-card.is-dark .license-cta:hover { color: var(--ink-950); }

.pricing-page .pricing-empty { color: var(--paper-mid); font-size: 16px; }

/* ---------------- memberships ---------------- */
.pricing-page .memberships-section { padding: 40px 0 120px; }
.pricing-page .membership-panel {
    background: var(--ink-950);
    color: var(--text-hi);
    padding: 80px 64px;
}
.pricing-page .membership-panel h2 {
    font-size: clamp(30px, 3.6vw, 44px);
    font-weight: 500;
    letter-spacing: -0.02em;
    margin: 0 0 24px;
    color: var(--text-hi);
}
.pricing-page .membership-intro {
    font-size: 16px;
    color: var(--text-mid);
    max-width: 60ch;
    line-height: 1.65;
    margin: 0 0 56px;
}

/* hairline grid: 1px gaps over a lighter background read as dividers */
.pricing-page .tier-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.pricing-page .tier-card {
    background: var(--ink-950);
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    border: none;
    border-radius: 0;
    box-shadow: none;
    transform: none;
}
.pricing-page .tier-card:hover { transform: none; box-shadow: none; border: none; }

.pricing-page .tier-name { margin-bottom: 8px; letter-spacing: 0.24em; }
.pricing-page .tier-who {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 15px;
    color: var(--gold);
    margin-bottom: 20px;
}
.pricing-page .tier-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 24px;
}
.pricing-page .tier-price .amount {
    font-family: var(--font-serif);
    font-size: 44px;
    line-height: 1;
    color: var(--text-hi);
}
.pricing-page .tier-price .per { font-size: 13px; color: var(--text-low); }

.pricing-page .tier-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 11px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-mid);
    flex: 1;
    margin: 0;
    padding: 0;
}
.pricing-page .tier-features li { display: flex; gap: 10px; align-items: baseline; }
.pricing-page .tier-features .tick { color: var(--gold); flex-shrink: 0; }

.pricing-page .tier-cta {
    cursor: pointer;
    margin-top: 28px;
    font-family: var(--font-body);
    font-size: 14.5px;
    font-weight: 500;
    padding: 13px 0;
    border-radius: 999px;
    border: none;
    background: var(--paper);
    color: var(--ink-950);
    transition: background 0.2s;
    width: 100%;
}
.pricing-page .tier-cta:hover { background: var(--gold); color: var(--ink-950); }

.pricing-page .membership-note {
    margin: 40px 0 0;
    font-size: 13.5px;
    color: var(--text-faint);
}

/* ---------------- modals ---------------- */
.license-modal .license-modal-content,
#membership-checkout-modal .license-modal-content,
#terms-modal .license-modal-content {
    background: #0D1C3E;
    color: var(--text-hi);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 0;
}
/* ---- Membership popup ------------------------------------------------------
   Ported from the popup in Pricing.dc.html. A single column: plan heading,
   a 1-2-3 progress line, the details form, then the account note. Steps 2 and
   3 are Stripe's hosted page and membership-success.php, so this only ever
   renders step 1 — the other two are shown greyed for orientation.
   -------------------------------------------------------------------------- */

.membership-modal {
    max-width: 560px;
    width: 100%;
    padding: 44px 48px;
    box-sizing: border-box;
    max-height: 86vh;
    overflow-y: auto;
}

.membership-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}
.membership-modal .kicker {
    font-size: 11px;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 10px;
}
.membership-modal-title {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 36px;
    line-height: 1.1;
    color: var(--text-hi);
    margin: 0;
}
.membership-modal-title em {
    font-style: italic;
    color: var(--gold);
}
.membership-modal #modal-plan-price-info {
    display: block;
    margin-top: 10px;
    font-size: 12.5px;
    color: var(--text-faint);
}

/* The close button is in the flow here, not absolutely placed over the corner. */
.membership-modal .close-modal-btn {
    position: static;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: none;
    color: #C6D0E4;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: border-color .2s, color .2s;
}
.membership-modal .close-modal-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.membership-progress {
    display: flex;
    gap: 10px;
    margin: 24px 0 28px;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #5A6B8F;
}
.membership-progress .is-current { color: var(--gold); }
.membership-progress .sep { color: #35548F; }

.membership-modal #checkout-view {
    display: block;
    padding: 0;
}
/* The form used to be the 55% right-hand column of a two-column modal, with
   its own 2.5rem of padding. The left column is gone, so those two rules left
   the fields sitting in a narrow strip inside a much wider box. The panel
   supplies the padding now. */
.membership-modal #membership-checkout-form {
    width: 100%;
    padding: 0;
}
.membership-modal .form-group label {
    font-size: 11px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--text-faint);
}
.membership-modal .terms-group label {
    letter-spacing: 0;
    text-transform: none;
    font-size: 13px;
    color: var(--text-mid);
}
.membership-modal .auth-button {
    width: 100%;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 500;
    padding: 14px 0;
}

.membership-account-hint {
    margin: 16px 0 0;
    text-align: center;
    font-size: 12.5px;
    line-height: 1.55;
    color: #5A6B8F;
}

@media (max-width: 600px) {
    .membership-modal { padding: 32px 24px; }
    .membership-modal-title { font-size: 28px; }
}

/* ---------------- responsive ---------------- */
@media (max-width: 1000px) {
    .pricing-page .license-grid { grid-template-columns: repeat(2, 1fr); }
    .pricing-page .license-card { grid-column: span 1; min-height: 0; }
    .pricing-page .tier-grid { grid-template-columns: 1fr; }
    .pricing-page .membership-panel { padding: 56px 32px; }
}
@media (max-width: 640px) {
    .pricing-page .license-grid { grid-template-columns: 1fr; }
    .pricing-page .licenses-section { padding: 64px 0; }
    .pricing-page .memberships-section { padding: 24px 0 72px; }
    .pricing-page .membership-panel { padding: 40px 22px; }
}

/* ---------------- billing frequency toggle ----------------
   The segmented pill from Pricing.dc.html. It replaces the checkbox that was
   deleted with the redesign — the one whose absence left a null read in
   pricing.js and broke membership signup. Behaviour: assets/js/pages/pricing.js. */
.pricing-page .membership-intro { margin-bottom: 40px; }

.pricing-page .billing-toggle {
    display: inline-flex;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    padding: 4px;
    margin-bottom: 40px;
}
.pricing-page .billing-option {
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    padding: 9px 22px;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: var(--text-faint);
    cursor: pointer;
    transition: background .2s, color .2s;
    white-space: nowrap;
}
.pricing-page .billing-option:hover { color: var(--text-mid); }
.pricing-page .billing-option.active {
    background: var(--text-hi);
    color: var(--ink-950);
}

/* The price block sits tighter so the effective-monthly line below it reads as
   part of the same unit. Reserves its height so cards do not jump on toggle. */
.pricing-page .tier-price { margin-bottom: 6px; }
.pricing-page .price-sub {
    font-size: 12.5px;
    color: #5A6B8F;
    margin-bottom: 24px;
    min-height: 15px;
}

@media (max-width: 520px) {
    .pricing-page .billing-toggle { width: 100%; }
    .pricing-page .billing-option { flex: 1; padding: 9px 0; }
}
