/* ─── Beast Forge Subscribe Page ──────────────────────────────────────────── */

/* Re-use root tokens from styles.css:
   --black, --teal, --dark-teal, --gray, --white, --light-gray              */

/* ── Layout ──────────────────────────────────────────────────────────────── */

.subscribe-page {
    background-color: var(--white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.sub-main {
    flex: 1;
    padding-top: 72px; /* height of fixed header */
}

/* ── Header ──────────────────────────────────────────────────────────────── */

.sub-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: var(--black);
    padding: 12px 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.sub-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sub-logo img {
    height: 44px;
    display: block;
}

.sub-back-link {
    color: var(--gray);
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.sub-back-link:hover {
    color: var(--white);
}

/* ── State visibility helper ─────────────────────────────────────────────── */

.sub-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 72px - 60px); /* viewport minus header/footer */
}

/* Explicitly override: .sub-state { display: flex } has the same specificity as
   the browser's built-in [hidden] { display: none }, so author styles win the tie
   and every section stays visible. This rule has higher specificity [0,2,0] and
   ensures hidden sections are actually hidden. */
.sub-state[hidden] {
    display: none;
}

/* ── Loading ─────────────────────────────────────────────────────────────── */

.sub-state--loading {
    color: var(--gray);
    gap: 16px;
    font-size: 0.95rem;
}

.sub-spinner {
    font-size: 2.5rem;
    color: var(--teal);
}

/* ── Result card (success / canceled / subscribed) ───────────────────────── */

.sub-result-card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.1);
    padding: 56px 48px;
    max-width: 520px;
    width: 90%;
    text-align: center;
}

.sub-result-icon {
    font-size: 3.5rem;
    margin-bottom: 24px;
}

.sub-result-icon--success {
    color: #22c55e;
}

.sub-result-icon--canceled {
    color: var(--gray);
}

.sub-result-card h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--black);
}

.sub-result-card > p {
    color: #555;
    margin-bottom: 32px;
    line-height: 1.6;
}

.sub-result-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.sub-hint {
    font-size: 0.8rem;
    color: var(--gray);
    margin-bottom: 0 !important;
}

.sub-manage-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.sub-divider {
    color: var(--gray);
}

/* ── Auth Section ─────────────────────────────────────────────────────────── */

.sub-state--auth {
    background: var(--light-gray);
    padding: 48px 20px;
    min-height: calc(100vh - 72px - 60px);
}

.sub-auth-wrap {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
    padding: 48px;
    width: 100%;
    max-width: 440px;
}

.sub-auth-brand {
    text-align: center;
    margin-bottom: 32px;
}

.sub-auth-brand h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--black);
}

.sub-brand-accent {
    color: var(--teal);
}

.sub-auth-brand p {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Tabs */
.sub-auth-tabs {
    display: flex;
    background: var(--light-gray);
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 28px;
    gap: 4px;
}

.sub-tab {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    background: transparent;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray);
    cursor: pointer;
    transition: all 0.2s;
}

.sub-tab--active {
    background: var(--white);
    color: var(--black);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Auth form panels */
.sub-auth-panel[hidden] {
    display: none;
}

.sub-form-group {
    margin-bottom: 20px;
}

.sub-form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--black);
    margin-bottom: 6px;
}

.sub-form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    transition: border-color 0.2s;
    outline: none;
}

.sub-form-group input:focus {
    border-color: var(--teal);
}

.sub-input-wrap {
    position: relative;
}

.sub-input-wrap input {
    padding-right: 44px;
}

.sub-pw-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 4px;
    transition: color 0.2s;
}

.sub-pw-toggle:hover {
    color: var(--black);
}

.sub-form-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    color: #b91c1c;
    font-size: 0.85rem;
    padding: 10px 14px;
    margin-bottom: 16px;
}

.sub-form-error[hidden] {
    display: none;
}

.sub-auth-note {
    font-size: 0.78rem;
    color: var(--gray);
    text-align: center;
    margin-top: 20px;
    line-height: 1.5;
}

.sub-auth-note a {
    color: var(--teal);
    text-decoration: underline;
}

/* ── Pricing Section ─────────────────────────────────────────────────────── */

.sub-state--pricing {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    min-height: 0;
}

.sub-pricing-hero {
    background: var(--black);
    color: var(--white);
    padding: 72px 20px 64px;
    text-align: center;
}

.sub-pricing-badge {
    display: inline-block;
    background: var(--teal);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 20px;
}

.sub-pricing-hero h1 {
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.sub-pricing-hero p {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.75);
    max-width: 540px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Plans */
.sub-plans-wrap {
    padding: 60px 20px 40px;
    background: var(--light-gray);
}

.sub-plans-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    max-width: 880px;
    margin: 0 auto;
}

.sub-plan-card {
    background: var(--white);
    border-radius: 16px;
    padding: 40px 32px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: box-shadow 0.25s, border-color 0.25s;
}

.sub-plan-card:hover {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
}

.sub-plan-card--featured {
    border-color: var(--teal);
    background: var(--black);
    color: var(--white);
}

.sub-plan-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--teal);
    color: var(--white);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 14px;
    border-radius: 20px;
    white-space: nowrap;
}

.sub-plan-header {
    margin-bottom: 28px;
}

.sub-plan-name {
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 12px;
}

.sub-plan-card--featured .sub-plan-name {
    color: var(--teal);
}

.sub-plan-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 6px;
}

.sub-price-amount {
    font-size: 2.5rem;
    font-weight: 800;
}

.sub-price-period {
    font-size: 0.9rem;
    color: var(--gray);
}

.sub-plan-card--featured .sub-price-period {
    color: rgba(255, 255, 255, 0.6);
}

.sub-plan-desc {
    font-size: 0.82rem;
    color: var(--gray);
    line-height: 1.4;
}

.sub-plan-card--featured .sub-plan-desc {
    color: rgba(255, 255, 255, 0.55);
}

/* Features */
.sub-plan-features {
    list-style: none;
    margin: 0 0 32px;
    flex: 1;
}

.sub-plan-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    padding: 7px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.sub-plan-card--featured .sub-plan-features li {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.sub-plan-features li i {
    color: var(--teal);
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* CTA button variants */
.btn-secondary-dark {
    background-color: transparent;
    color: var(--black);
    border: 2px solid var(--black);
}

.btn-secondary-dark:hover {
    background-color: var(--black);
    color: var(--white);
}

.sub-plan-cta {
    width: 100%;
    text-align: center;
    padding: 14px;
}

/* Checkout error */
.sub-checkout-error {
    max-width: 880px;
    margin: 16px auto 0;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    color: #b91c1c;
    font-size: 0.875rem;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sub-checkout-error[hidden] {
    display: none;
}

/* Already-subscribed row */
.sub-already-block {
    max-width: 880px;
    margin: 28px auto 0;
    text-align: center;
    font-size: 0.875rem;
    color: #555;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sub-sign-out-row {
    font-size: 0.82rem;
    color: var(--gray);
}

/* ── Trust bar ────────────────────────────────────────────────────────────── */

.sub-trust-bar {
    background: var(--black);
    padding: 20px;
}

.sub-trust-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.82rem;
    font-weight: 500;
}

.sub-trust-inner span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sub-trust-inner i {
    color: var(--teal);
}

/* ── Shared button helpers ───────────────────────────────────────────────── */

.sub-btn-full {
    width: 100%;
    padding: 14px;
    text-align: center;
    font-size: 0.95rem;
}

.btn-ghost {
    background: transparent;
    color: #555;
    border: 1.5px solid #ccc;
}

.btn-ghost:hover {
    border-color: var(--black);
    color: var(--black);
}

.sub-text-btn {
    background: none;
    border: none;
    color: var(--teal);
    font-family: 'Montserrat', sans-serif;
    font-size: inherit;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.sub-text-btn:hover {
    color: var(--dark-teal);
}

.sub-text-btn--danger {
    color: #b91c1c;
}

.sub-text-btn--danger:hover {
    color: #991b1b;
}

/* btn-loading toggle helpers */
.btn-loading[hidden] {
    display: none;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

.sub-footer {
    background-color: var(--black);
    color: rgba(255, 255, 255, 0.5);
    padding: 24px 0;
    font-size: 0.82rem;
}

.sub-footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.sub-footer-links {
    display: flex;
    gap: 20px;
}

.sub-footer-links a {
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.2s;
}

.sub-footer-links a:hover {
    color: var(--white);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .sub-plans-grid {
        grid-template-columns: 1fr;
        max-width: 420px;
    }

    .sub-pricing-hero h1 {
        font-size: 2rem;
    }

    .sub-result-card {
        padding: 40px 28px;
    }

    .sub-auth-wrap {
        padding: 36px 24px;
    }

    .sub-trust-inner {
        gap: 20px;
    }

    .sub-footer-inner {
        flex-direction: column;
        text-align: center;
    }

    .sub-header-inner {
        padding: 0 16px;
    }
}

@media (max-width: 480px) {
    .sub-back-link span {
        display: none;
    }

    .sub-pricing-hero {
        padding: 56px 16px 48px;
    }

    .sub-pricing-hero h1 {
        font-size: 1.75rem;
    }
}
