/* SMTM Subscribe: front-end styling.
   The look is driven by CSS variables scoped to the plugin's own containers, so a
   site on the same brand palette gets this automatically, and a site with a
   different scheme can restyle the whole form by overriding these variables. The
   defaults below match the SMTM brand (navy, gold, warm cream). */

.smtm-sub-form,
.smtm-sub-manage,
.smtm-sub-note {
    --smtm-navy:   #1B2D5E;
    --smtm-gold:   #B8893A;
    --smtm-cream:  #FAF8F3;
    --smtm-cream2: #F2EDE3;
    --smtm-ink:    #1A1A2E;
    --smtm-muted:  #5C5870;
    --smtm-border: rgba(27, 45, 94, 0.14);
    --smtm-radius: 12px;

    max-width: 520px;
    margin: 2rem auto;
    font-family: 'DM Sans', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--smtm-ink);
    line-height: 1.55;
}

/* Headings pick up the serif display face used across the brand. */
.smtm-sub-note h2,
.smtm-sub-manage h2 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--smtm-navy);
    font-weight: 600;
    font-size: 1.5rem;
    margin: 0 0 .5rem;
}

/* Fields */
.smtm-sub-field { margin-bottom: 1.1rem; }
.smtm-sub-field label {
    display: block;
    font-weight: 600;
    font-size: .95rem;
    letter-spacing: .01em;
    margin-bottom: .4rem;
    color: var(--smtm-ink);
}
.smtm-sub-form input[type="text"],
.smtm-sub-form input[type="email"] {
    width: 100%;
    box-sizing: border-box;
    padding: .8rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--smtm-ink);
    background: #fff;
    border: 1px solid var(--smtm-border);
    border-radius: 10px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.smtm-sub-form input::placeholder { color: #a7a3b3; }
.smtm-sub-form input[type="text"]:focus,
.smtm-sub-form input[type="email"]:focus {
    outline: none;
    border-color: var(--smtm-gold);
    box-shadow: 0 0 0 3px rgba(184, 137, 58, 0.18);
}

/* Plan cards: term, price, period, with a clear selected state. */
.smtm-sub-plans {
    display: flex;
    gap: .9rem;
    flex-wrap: wrap;
    margin: 1.25rem 0;
}
.smtm-sub-plan {
    position: relative;
    flex: 1 1 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.4rem 1rem 1.2rem;
    background: #fff;
    border: 1.5px solid var(--smtm-border);
    border-radius: var(--smtm-radius);
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.smtm-sub-plan:hover { border-color: rgba(27, 45, 94, 0.35); }
.smtm-sub-plan input { position: absolute; opacity: 0; pointer-events: none; }
.smtm-sub-plan-tick {
    position: absolute;
    top: .7rem;
    right: .7rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid var(--smtm-border);
    background: #fff;
    transition: background .15s ease, border-color .15s ease;
}
.smtm-sub-plan-term {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.15rem;
    color: var(--smtm-navy);
    margin-bottom: .35rem;
}
.smtm-sub-plan-price {
    font-size: 1.9rem;
    font-weight: 600;
    color: var(--smtm-ink);
    line-height: 1.1;
}
.smtm-sub-plan:has(input:checked) {
    border-color: var(--smtm-navy);
    background: var(--smtm-cream2);
    box-shadow: 0 3px 14px rgba(27, 45, 94, 0.10);
}
.smtm-sub-plan:has(input:checked) .smtm-sub-plan-tick {
    background: var(--smtm-gold);
    border-color: var(--smtm-gold);
}
.smtm-sub-plan:has(input:checked) .smtm-sub-plan-tick::after {
    content: "";
    position: absolute;
    left: 6px; top: 2.5px;
    width: 5px; height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.smtm-sub-plan:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(184, 137, 58, 0.25); }

/* Consents */
.smtm-sub-consents { margin: 1.25rem 0; font-size: .92rem; color: var(--smtm-muted); }
.smtm-sub-consents label { display: block; margin: .55rem 0; line-height: 1.5; }
.smtm-sub-consents input { accent-color: var(--smtm-gold); margin-right: .4rem; }
.smtm-sub-form a { color: var(--smtm-gold); text-decoration: underline; text-underline-offset: 2px; }

/* Terms panel */
.smtm-sub-terms {
    border: 1px solid var(--smtm-border);
    background: var(--smtm-cream);
    padding: 1rem 1.2rem;
    border-radius: var(--smtm-radius);
    margin: 1rem 0;
    max-height: 240px;
    overflow: auto;
    font-size: .9rem;
    color: var(--smtm-muted);
}

/* Buttons */
.smtm-sub-btn {
    background: var(--smtm-navy);
    color: var(--smtm-cream);
    border: 1px solid var(--smtm-navy);
    border-radius: 10px;
    padding: .85rem 1.8rem;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 600;
    letter-spacing: .02em;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .05s ease;
}
.smtm-sub-btn:hover { background: var(--smtm-gold); border-color: var(--smtm-gold); }
.smtm-sub-btn:active { transform: translateY(1px); }
.smtm-sub-btn-secondary { background: transparent; color: var(--smtm-navy); }
.smtm-sub-btn-secondary:hover { background: var(--smtm-navy); color: var(--smtm-cream); border-color: var(--smtm-navy); }
.smtm-sub-btn-danger { background: #B03A3A; border-color: #B03A3A; color: #fff; }
.smtm-sub-btn-danger:hover { background: #8f2d2d; border-color: #8f2d2d; }

/* Notes / callouts */
.smtm-sub-note {
    padding: 1.2rem 1.4rem;
    border-radius: var(--smtm-radius);
    background: var(--smtm-cream);
    border: 1px solid var(--smtm-border);
    border-left: 4px solid var(--smtm-gold);
}
.smtm-sub-note p { margin: .4rem 0; }
.smtm-sub-success { background: #EEF7F0; border-color: #cfe8d6; border-left-color: #4CAF82; }
.smtm-sub-error   { background: #FBF0F0; border-color: #f0d2d2; border-left-color: #C0504E; }

/* Manage subscription */
.smtm-sub-table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; }
.smtm-sub-table th,
.smtm-sub-table td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--smtm-border); }
.smtm-sub-table th { color: var(--smtm-navy); font-weight: 600; width: 40%; }
.smtm-sub-action { margin: 1.2rem 0; }
.smtm-sub-hint, .smtm-sub-confirm { display: block; font-size: .88rem; color: var(--smtm-muted); margin: .5rem 0; }
.smtm-sub-danger { border-top: 1px solid var(--smtm-border); padding-top: 1.2rem; margin-top: 1.5rem; }

/* Small screens */
@media (max-width: 480px) {
    .smtm-sub-plan { flex: 1 1 100%; }
}

/* Completion screen */
.smtm-sub-complete {
    text-align: center;
    border-left: none;
    padding: 2.2rem 1.6rem;
}
.smtm-sub-complete h2 { text-align: center; }
.smtm-sub-complete-badge {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: var(--smtm-cream2);
    display: flex;
    align-items: center;
    justify-content: center;
}
.smtm-sub-complete.is-ready .smtm-sub-complete-badge { background: var(--smtm-gold); }
.smtm-sub-complete-msg { color: var(--smtm-muted); }
.smtm-sub-complete-ready p { color: var(--smtm-ink); margin-bottom: 1.2rem; }
.smtm-sub-complete .smtm-sub-btn { display: inline-block; text-decoration: none; }

/* Spinner while provisioning is confirmed */
.smtm-sub-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(27, 45, 94, 0.15);
    border-top-color: var(--smtm-navy);
    border-radius: 50%;
    animation: smtm-sub-spin 0.8s linear infinite;
}
@keyframes smtm-sub-spin { to { transform: rotate(360deg); } }

/* Tick shown once ready */
.smtm-sub-check {
    width: 14px;
    height: 22px;
    border: solid #fff;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
    margin-top: -4px;
}

/* ─────────────────────────────────────────────────────────────────────────
   Branded Subscribe page (auto-created on activation). All styling is scoped
   to .smtm-page / body.smtm-subscribe-page so it affects only that page.
   ───────────────────────────────────────────────────────────────────────── */

/* Hide theme chrome on the subscribe page only. Add your theme's selectors here
   if the header or title still shows. */
body.smtm-subscribe-page #masthead,
body.smtm-subscribe-page .site-header,
body.smtm-subscribe-page header.site-header,
body.smtm-subscribe-page .main-navigation,
body.smtm-subscribe-page .wp-site-blocks > header,
body.smtm-subscribe-page > header,
body.smtm-subscribe-page .entry-title,
body.smtm-subscribe-page .page-title,
body.smtm-subscribe-page .wp-block-post-title,
body.smtm-subscribe-page .page-header,
body.smtm-subscribe-page #colophon,
body.smtm-subscribe-page .site-footer,
body.smtm-subscribe-page footer.site-footer { display: none !important; }
body.smtm-subscribe-page .entry-content,
body.smtm-subscribe-page .site-content,
body.smtm-subscribe-page .content-area { margin: 0 !important; padding: 0 !important; max-width: none !important; }

.smtm-page {
    --smtm-navy:   #1B2D5E;
    --smtm-gold:   #B8893A;
    --smtm-cream:  #FAF8F3;
    --smtm-cream2: #E8E0D0;
    --smtm-ink:    #1A1A2E;
    --smtm-muted:  #5C5870;
    --smtm-border: rgba(27, 45, 94, 0.12);
    font-family: 'DM Sans', system-ui, sans-serif;
    color: var(--smtm-ink);
    background: linear-gradient(160deg, #FAF8F3 0%, #EDE6D6 100%);
    min-height: 100vh;
    margin: 0;
}
.smtm-page-nav {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 48px; background: rgba(250, 248, 243, 0.96);
    border-bottom: 1px solid var(--smtm-border); position: sticky; top: 0; z-index: 10;
}
.smtm-page-brand { font-family: 'Playfair Display', serif; font-size: 18px; color: var(--smtm-navy); font-weight: 600; text-decoration: none; }
.smtm-page-nav-links { display: flex; align-items: center; gap: 22px; }
.smtm-page-home { color: var(--smtm-navy); font-weight: 500; font-size: 14px; text-decoration: none; opacity: .85; transition: opacity .2s ease; }
.smtm-page-home:hover { opacity: 1; }
.smtm-page-login {
    background: var(--smtm-gold); color: var(--smtm-navy); border-radius: 6px;
    padding: 10px 24px; font-weight: 600; font-size: 14px; text-decoration: none; transition: background .2s ease;
}
.smtm-page-login:hover { background: #d4b06a; }
.smtm-page-hero { text-align: center; padding: 72px 24px 8px; position: relative; }
.smtm-page-grid {
    position: absolute; inset: 0; opacity: .035; pointer-events: none;
    background-image: linear-gradient(var(--smtm-navy) 1px, transparent 1px), linear-gradient(90deg, var(--smtm-navy) 1px, transparent 1px);
    background-size: 60px 60px;
}
.smtm-page-eyebrow {
    display: inline-block; background: rgba(184, 137, 58, 0.1); border: 1px solid rgba(184, 137, 58, 0.35);
    border-radius: 100px; padding: 6px 16px; font-size: 12px; font-weight: 500; color: var(--smtm-gold);
    letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 24px; position: relative;
}
.smtm-page-hero h1 {
    font-family: 'Playfair Display', serif; font-size: clamp(34px, 5vw, 54px); font-weight: 900;
    line-height: 1.1; color: var(--smtm-navy); margin: 0 0 14px; position: relative;
}
.smtm-page-tagline {
    font-family: 'Playfair Display', serif; font-style: italic; font-weight: 700;
    color: var(--smtm-gold); font-size: clamp(15px, 2vw, 20px); margin: 0 0 18px; position: relative;
}
.smtm-page-sub {
    font-size: 16px; color: rgba(26, 26, 46, 0.62); line-height: 1.7; max-width: 540px;
    margin: 0 auto; position: relative;
}
.smtm-page-body { padding: 8px 24px 80px; }
.smtm-page-card {
    max-width: 560px; margin: 0 auto; background: #fff; border: 1px solid var(--smtm-border);
    border-radius: 16px; padding: 8px 32px 24px; box-shadow: 0 10px 40px rgba(27, 45, 94, 0.06);
}
.smtm-page-foot {
    text-align: center; padding: 28px 24px 40px; color: var(--smtm-muted); font-size: 13px;
    border-top: 1px solid var(--smtm-border);
}
.smtm-page-foot a { color: var(--smtm-gold); text-decoration: none; }
@media (max-width: 640px) {
    .smtm-page-nav { padding: 16px 24px; }
    .smtm-page-card { padding: 8px 18px 20px; }
}

/* Standalone template: let the branded page reach the viewport edges (the theme's
   own body reset is not present on this bare template, so restore it here). */
body.smtm-subscribe-standalone { margin: 0 !important; padding: 0 !important; background: #FAF8F3; }
body.smtm-subscribe-standalone .smtm-page { width: 100%; box-sizing: border-box; }

/* Fine print under the Subscribe button (Stripe / recurring / cancellation). */
.smtm-sub-fineprint {
    font-size: .82rem;
    color: var(--smtm-muted);
    line-height: 1.5;
    margin: .9rem 0 0;
}
.smtm-sub-fineprint a { color: var(--smtm-gold); text-decoration: underline; text-underline-offset: 2px; }

.smtm-sub-optional { font-weight: 400; color: var(--smtm-muted); font-size: .85em; }

/* Branded template: readable prose column for general pages (Terms, Privacy, etc.). */
.smtm-page-prose {
    max-width: 760px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--smtm-border, rgba(27,45,94,0.12));
    border-radius: 16px;
    padding: 36px 44px;
    box-shadow: 0 10px 40px rgba(27, 45, 94, 0.06);
    color: #1A1A2E;
    line-height: 1.7;
}
.smtm-page-prose h1, .smtm-page-prose h2, .smtm-page-prose h3, .smtm-page-prose h4 {
    font-family: 'Playfair Display', Georgia, serif;
    color: #1B2D5E;
    line-height: 1.25;
    margin: 1.6em 0 .5em;
}
.smtm-page-prose h2 { font-size: 1.5rem; }
.smtm-page-prose h3 { font-size: 1.2rem; }
.smtm-page-prose p, .smtm-page-prose li { font-size: 1rem; color: #2b2a3a; }
.smtm-page-prose a { color: #B8893A; text-decoration: underline; text-underline-offset: 2px; }
.smtm-page-prose ul, .smtm-page-prose ol { padding-left: 1.3em; }
.smtm-page-prose li { margin: .4em 0; }
.smtm-page-prose hr { border: none; border-top: 1px solid var(--smtm-border, rgba(27,45,94,0.12)); margin: 1.8em 0; }
.smtm-page-prose strong { color: #1B2D5E; }
@media (max-width: 640px) {
    .smtm-page-prose { padding: 24px 20px; }
}
