/* ==================================================
   Nuclear Fancy Pants Edition™ — NUCLEAR+++
   File: assets/css/plans.css
   Description: Billing & Plans — full redesign, global toggle, animated prices, nudge boxes
   Last Edited: 2026-03-30
   ================================================== */

@import url('fonts.css');
@import url('tabs.css');

/* ── Reset & scope ─────────────────────────────────────────── */
#amai-billing-root,
#amai-billing-root *,
.am-modal-overlay,
.am-modal-overlay * {
    box-sizing: border-box;
}

/* ── Tokens ────────────────────────────────────────────────── */
#amai-billing-root {
    --clay:         #D97757;
    --clay-mid:     #C4623E;
    --clay-light:   #F7EDE6;
    --clay-pale:    #FDF8F5;
    --clay-dark:    #993C1D;
    --ink:          #1C1917;
    --stone:        #78716C;
    --stone-lt:     #A8A29E;
    --parchment:    #FAF8F5;
    --white:        #FFFFFF;
    --border:       #E7DDD5;
    --green:        #166534;
    --green-bg:     #DCFCE7;
    --green-s:      #15803D;
    --r-sm:         8px;
    --r:            14px;
    --r-lg:         18px;
    --sh-sm:        0 2px 8px rgba(28,25,23,0.07);
    --sh:           0 8px 28px rgba(28,25,23,0.11), 0 2px 8px rgba(28,25,23,0.05);
    font-family: 'DM Sans', -apple-system, sans-serif;
}

/* ── Page header ───────────────────────────────────────────── */
#amai-billing-root .am-bill-header {
    padding: 24px 0 24px;
    margin-bottom: 32px;
    text-align: center;
}
#amai-billing-root .am-bill-title {
    font-family: 'Nunito', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: var(--clay) !important;
    -webkit-text-fill-color: var(--clay) !important;
    background: none !important;
    margin: 0 0 6px;
    line-height: 1.2;
}
#amai-billing-root .am-bill-sub {
    font-size: 0.95rem;
    color: var(--stone);
    margin: 0 0 20px;
}

/* ── Shared tab nav — rendered by templates/partials/tabs.php ── */

/* ── Global toggle ─────────────────────────────────────────── */
#amai-billing-root .am-global-toggle-wrap {
    display: flex;
    justify-content: center;
}
#amai-billing-root .am-global-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--parchment);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 6px 18px;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.18s;
}
#amai-billing-root .am-global-toggle:hover { border-color: var(--clay); }
#amai-billing-root .am-gtog-lbl {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--stone-lt);
    transition: color 0.2s;
    min-width: 48px;
    text-align: center;
}
#amai-billing-root .am-gtog-lbl.am-active { color: var(--ink); font-weight: 700; }
#amai-billing-root .am-gtog-track {
    width: 40px;
    height: 23px;
    border-radius: 100px;
    background: var(--clay);
    position: relative;
    transition: background 0.25s;
    flex-shrink: 0;
}
#amai-billing-root .am-gtog-track.am-monthly { background: var(--border); }
#amai-billing-root .am-gtog-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: white;
    transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
    box-shadow: 0 1px 3px rgba(28,25,23,0.2);
}
#amai-billing-root .am-gtog-track.am-yearly .am-gtog-thumb { transform: translateX(17px); }
#amai-billing-root .am-gtog-pill {
    font-size: 11px;
    font-weight: 700;
    background: var(--clay-light);
    color: var(--clay-dark);
    border-radius: 100px;
    padding: 3px 10px;
    letter-spacing: 0.02em;
    transition: opacity 0.2s;
}
#amai-billing-root .am-gtog-pill.am-hidden { opacity: 0; pointer-events: none; }

/* ── Notice ────────────────────────────────────────────────── */
#amai-billing-root .am-bill-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 15px;
    border-radius: var(--r-sm);
    font-size: 13px;
    line-height: 1.55;
    margin-bottom: 24px;
}
#amai-billing-root .am-bill-notice.success,
#amai-billing-root .am-bill-notice.info {
    background: var(--clay-pale);
    border-left: 3px solid var(--clay);
    color: var(--ink);
}

/* ── Grid ──────────────────────────────────────────────────── */
#amai-billing-root .am-plan-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-bottom: 60px;
    align-items: start;
}
@media (max-width: 1300px) { #amai-billing-root .am-plan-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 860px)  { #amai-billing-root .am-plan-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px)  { #amai-billing-root .am-plan-grid { grid-template-columns: 1fr; } }

/* ── Plan card ─────────────────────────────────────────────── */
#amai-billing-root .am-plan-card {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--r-lg);
    padding: 0 0 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--sh-sm);
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s;
}
#amai-billing-root .am-plan-card:hover          { transform: translateY(-4px); box-shadow: var(--sh); }
#amai-billing-root .am-plan-card.is-featured    { border-color: var(--clay); box-shadow: 0 0 0 1px var(--clay), var(--sh); }
#amai-billing-root .am-plan-card.is-current     { border-color: var(--green-s); background: #F0FDF4; }

/* ── Banners ───────────────────────────────────────────────── */
#amai-billing-root .am-plan-banner {
    font-family: 'Nunito', sans-serif;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    text-align: center;
    padding: 7px 0;
    color: white;
}
#amai-billing-root .am-plan-banner--popular { background: var(--clay); }
#amai-billing-root .am-plan-banner--current { background: var(--green-s); }
#amai-billing-root .am-plan-banner-spacer   { height: 0; }

/* ── Card body ─────────────────────────────────────────────── */
#amai-billing-root .am-card-body {
    padding: 20px 20px 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ── Plan name ─────────────────────────────────────────────── */
#amai-billing-root .am-plan-name {
    font-family: 'Nunito', sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--ink);
    margin: 0 0 16px;
    line-height: 1.2;
    text-align: center;
}

/* ── Price block ───────────────────────────────────────────── */
#amai-billing-root .am-price-block { margin-bottom: 16px; min-height: 72px; text-align: center; }
#amai-billing-root .am-price {
    font-family: 'Nunito', sans-serif;
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--ink);
    line-height: 1;
    display: block;
}
#amai-billing-root .am-price--free {
    font-family: 'Nunito', sans-serif;
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--green);
    line-height: 1;
    display: block;
    margin-bottom: 4px;
}
#amai-billing-root .am-price-sub    { font-size: 12px; color: var(--stone-lt); margin-top: 4px; display: block; }
#amai-billing-root .am-price-period { font-size: 13px; color: var(--stone); font-weight: 400; margin-top: 2px; }

/* ── Price animation ───────────────────────────────────────── */
@keyframes am-price-flip {
    0%   { transform: translateY(-8px); opacity: 0; }
    100% { transform: translateY(0);    opacity: 1; }
}
#amai-billing-root .am-price-inner.am-animating {
    display: inline-block;
    animation: am-price-flip 0.35s cubic-bezier(0.34,1.3,0.64,1);
}

/* ── Savings line ──────────────────────────────────────────── */
#amai-billing-root .am-savings-line {
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 4px;
}
#amai-billing-root .am-savings-yearly { font-size: 12px; color: var(--green); font-weight: 600; }

/* ── Yearly nudge box ──────────────────────────────────────── */
#amai-billing-root .am-yearly-nudge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--clay-light);
    border: 1px dashed var(--clay);
    border-radius: var(--r-sm);
    padding: 6px 10px;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
    user-select: none;
    text-align: left;
}
#amai-billing-root .am-yearly-nudge:hover  { background: #F5C4B3; transform: scale(1.02); }
#amai-billing-root .am-yearly-nudge:active { transform: scale(0.98); }
#amai-billing-root .am-nudge-icon  { font-size: 14px; line-height: 1; flex-shrink: 0; }
#amai-billing-root .am-nudge-text  { font-size: 11px; font-weight: 600; color: var(--clay-dark); line-height: 1.35; }
#amai-billing-root .am-nudge-save  { font-size: 10px; font-weight: 400; color: var(--clay); display: block; }

/* ── Modules line ──────────────────────────────────────────── */
#amai-billing-root .am-modules-line {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--clay);
    margin-bottom: 12px;
    font-family: 'Nunito', sans-serif;
}

/* ── Feature list ──────────────────────────────────────────── */
#amai-billing-root .am-features { list-style: none; margin: 0 0 16px; padding: 0; flex: 1; }
#amai-billing-root .am-features li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12.5px;
    color: var(--stone);
    line-height: 1.55;
    margin-bottom: 7px;
}
#amai-billing-root .am-features li span.am-feat-text { flex: 1; min-width: 0; }
#amai-billing-root .am-features li.am-feature--key   { color: var(--ink); font-weight: 600; }
#amai-billing-root .am-features li::before {
    content: '';
    display: block;
    width: 16px;
    height: 16px;
    min-width: 16px;
    border-radius: 50%;
    background-color: var(--clay-light);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='8' viewBox='0 0 10 8'%3E%3Cpath d='M1 4l2.5 2.5L9 1' stroke='%23D97757' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
    margin-top: 2px;
}
#amai-billing-root .am-plan-card.is-current .am-features li::before {
    background-color: var(--green-bg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='8' viewBox='0 0 10 8'%3E%3Cpath d='M1 4l2.5 2.5L9 1' stroke='%2315803D' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ── Module link button ────────────────────────────────────── */
#amai-billing-root .am-module-link {
    background: none;
    border: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    color: var(--clay);
    cursor: pointer;
    padding: 0;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-style: dotted;
    margin-left: 2px;
}
#amai-billing-root .am-module-link:hover { color: var(--clay-mid); }

/* ── Bottom pitch text ─────────────────────────────────────── */
#amai-billing-root .am-pitch {
    font-size: 12.5px;
    color: var(--stone-lt);
    line-height: 1.6;
    margin-bottom: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-weight: 400;
}

/* ── Agency addon pills ────────────────────────────────────── */
#amai-billing-root .am-addon-section  { margin-top: 8px; margin-bottom: 4px; }
#amai-billing-root .am-addon-label    { font-size: 11px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
#amai-billing-root .am-addon-pills    { display: flex; gap: 6px; }
#amai-billing-root .am-addon-pill {
    font-family: 'Nunito', sans-serif;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: var(--r-sm);
    border: 1.5px solid var(--border);
    background: var(--white);
    color: var(--stone);
    cursor: pointer;
    transition: all 0.15s;
}
#amai-billing-root .am-addon-pill:hover        { border-color: var(--clay); color: var(--clay); }
#amai-billing-root .am-addon-pill--selected    { border-color: var(--clay); color: var(--clay-dark); background: var(--clay-light); }

/* ── CTA area ──────────────────────────────────────────────── */
#amai-billing-root .am-cta-wrap { padding: 12px 20px 0; margin-top: auto; }
#amai-billing-root .am-btn-upgrade {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 16px;
    background: var(--clay);
    color: white !important;
    border: none;
    border-radius: var(--r-sm);
    font-family: 'Nunito', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s, transform 0.1s;
    text-decoration: none;
    letter-spacing: 0.02em;
}
#amai-billing-root .am-btn-upgrade:hover          { background: var(--clay-mid); }
#amai-billing-root .am-btn-upgrade:active         { transform: scale(0.98); }
#amai-billing-root .am-btn-upgrade.secondary      { background: transparent; color: var(--clay) !important; border: 1.5px solid var(--clay-light); }
#amai-billing-root .am-btn-upgrade.secondary:hover { background: var(--clay-pale); border-color: var(--clay); }

#amai-billing-root .am-current-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--green);
    padding: 10px 0;
}
#amai-billing-root .am-current-label::before {
    content: '';
    display: block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green-s);
}

/* ── Modal overlay ─────────────────────────────────────────── */
.am-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(28,25,23,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    font-family: 'DM Sans', -apple-system, sans-serif;
}
.am-modal-overlay.am-open { opacity: 1; pointer-events: all; }
.am-modal-box {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 2rem;
    max-width: 420px;
    width: 90%;
    border: 1px solid #E7DDD5;
    transform: scale(0.95) translateY(8px);
    transition: transform 0.25s cubic-bezier(0.34,1.3,0.64,1);
}
.am-modal-overlay.am-open .am-modal-box { transform: scale(1) translateY(0); }
.am-modal-title {
    font-family: 'Nunito', sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    color: #1C1917;
    margin: 0 0 0.4rem;
}
.am-modal-sub { font-size: 14px; color: #78716C; margin-bottom: 1.25rem; line-height: 1.6; }
.am-module-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 1.25rem; }
.am-module-chip {
    background: #FAF8F5;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12.5px;
    color: #1C1917;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #E7DDD5;
}
.am-module-dot { width: 7px; height: 7px; border-radius: 50%; background: #D97757; flex-shrink: 0; }
.am-modal-close {
    width: 100%;
    padding: 11px;
    border-radius: 10px;
    border: 1.5px solid #E7DDD5;
    background: transparent;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #1C1917;
    cursor: pointer;
    transition: background 0.15s;
}
.am-modal-close:hover { background: #FAF8F5; }

/* ── Agency card — large yearly number ─────────────────────── */
#amai-billing-root .am-plan-card[data-slug="agency"] .am-price { font-size: 1.7rem; }

/* ── Hide WP footer ────────────────────────────────────────── */
#wpfooter,
#footer-thankyou {
    display: none !important;
}

/* ── Active plan ─────────────────────────────────────────── */
#amai-billing-root .am-plan-card.is-current             { border-color: var(--green-s); background: #F0FDF4; }
#amai-billing-root .am-plan-card.is-current .am-plan-banner--current { background: var(--green-s); }

/* ── Free card on paid plan ──────────────────────────────── */
#amai-billing-root .am-plan-card.is-inactive-free       { border-color: var(--border); background: var(--parchment); opacity: 0.85; }
#amai-billing-root .am-plan-card.is-inactive-free .am-price--free { color: var(--stone); }

/* ── Cancel button ───────────────────────────────────────── */
#amai-billing-root .am-btn-cancel {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 8px;
    background: transparent;
    border: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 11.5px;
    color: var(--stone-lt);
    cursor: pointer;
    text-align: center;
    transition: color 0.15s;
    text-decoration: underline;
    text-decoration-style: dotted;
}
#amai-billing-root .am-btn-cancel:hover { color: #dc2626; }

/* ── Downgrade button ────────────────────────────────────── */
#amai-billing-root .am-btn-downgrade {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 11px 16px;
    background: transparent;
    color: var(--stone) !important;
    border: 1.5px solid var(--border);
    border-radius: var(--r-sm);
    font-family: 'Nunito', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
#amai-billing-root .am-btn-downgrade:hover { background: var(--parchment); border-color: var(--stone-lt); color: var(--ink) !important; }

/* ── Cancel modal ────────────────────────────────────────── */
.am-modal-box--cancel { text-align: center; }
.am-cancel-icon       { font-size: 32px; margin-bottom: 0.5rem; color: #D97757; }
.am-refund-box {
    background: #F0FDF4;
    border: 1.5px solid #86efac;
    border-radius: 12px;
    padding: 1.25rem;
    margin: 1.25rem 0;
}
.am-refund-loading { font-size: 13px; color: var(--stone); font-style: italic; }
.am-refund-amount  { font-family: 'Nunito', sans-serif; font-size: 2.2rem; font-weight: 900; color: var(--green); line-height: 1; margin-bottom: 4px; }
.am-refund-label   { font-size: 12.5px; color: var(--green); font-weight: 500; }
.am-refund-note    { font-size: 12px; color: var(--stone-lt); margin-bottom: 1.25rem; font-style: italic; }
.am-modal-actions  { display: flex; gap: 10px; }
.am-modal-actions .am-btn-keep { flex: 1; }
.am-btn-confirm-cancel {
    flex: 1;
    padding: 11px;
    border-radius: 10px;
    border: none;
    background: #dc2626;
    color: white;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}
.am-btn-confirm-cancel:hover:not(:disabled) { background: #b91c1c; }
.am-btn-confirm-cancel:disabled             { opacity: 0.5; cursor: not-allowed; }

/* ── Addon price line ────────────────────────────────────── */
#amai-billing-root .am-addon-price-line {
    font-size: 12px;
    color: var(--stone);
    margin-top: 8px;
    min-height: 16px;
    transition: opacity 0.2s;
}

/* ── Utility classes ─────────────────────────────────────── */
.am-hidden {
    display: none;
}

/* ── Downgrade confirm modal ─────────────────────────────── */
.am-modal-box--downgrade { text-align: center; }
.am-dg-icon { font-size: 28px; margin-bottom: 0.5rem; color: #78716C; }
.am-dg-loss-box {
    background: #FDF8F5;
    border: 1.5px solid #E7DDD5;
    border-left: 3px solid #D97757;
    border-radius: 10px;
    padding: 1rem 1.1rem;
    margin: 1rem 0 1.25rem;
    text-align: left;
}
.am-dg-loss-text { font-size: 13px; color: #78716C; line-height: 1.65; margin: 0; }
.am-btn-confirm-downgrade {
    flex: 1;
    padding: 11px;
    border-radius: 10px;
    border: none;
    background: #78716C;
    color: white;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.am-btn-confirm-downgrade:hover { background: #57534e; }

/* ── Coming Soon pill (Agency) ───────────────────────── */
#amai-billing-root .am-coming-soon-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    padding: 12px 16px;
    background: #F9FAFB;
    color: #78716C;
    border: 1.5px dashed #D1C5BB;
    border-radius: 8px;
    font-family: 'Nunito', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: default;
    user-select: none;
}
#amai-billing-root .am-coming-soon-pill::before {
    content: 'F3';
    content: '★';
    font-size: 11px;
}

/* ── Upgrade preview modal ──────────────────────────────── */
.am-modal-box--upgrade { text-align: center; }
.am-modal-box--upgrade .am-modal-actions > * { flex: 1; }
.am-modal-box--downgrade .am-modal-actions > * { flex: 1; }
.am-upgrade-icon { font-size: 28px; margin-bottom: 0.5rem; color: #D97757; }
.am-upgrade-gain-box {
    background: #F0FDF4;
    border: 1.5px solid #86EFAC;
    border-left: 3px solid #15803D;
    border-radius: 10px;
    padding: 1rem 1.1rem;
    margin: 1rem 0 0.5rem;
    text-align: left;
}
.am-upgrade-gain-text { font-size: 13px; color: #166534; line-height: 1.65; margin: 0; }
.am-upgrade-price-note { font-size: 12px; color: #A8A29E; margin-bottom: 1.25rem; font-style: italic; }
.am-btn-confirm-upgrade {
    flex: 1;
    padding: 11px;
    border-radius: 10px;
    border: none;
    background: #D97757;
    color: white;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.am-btn-confirm-upgrade:hover { background: #C4623E; }

/* ── Deactivate license (free plan only) ── */
.am-bill-deactivate-wrap {
    text-align: center;
    margin: 8px 0 32px;
}

.am-bill-deactivate-btn {
    background: none;
    border: none;
    font-size: 12px;
    color: #A8A29E;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    transition: color 0.15s;
}

.am-bill-deactivate-btn:hover {
    color: #ef4444;
}
