/**
 * MAX Chat License Server — Buy & Legal Pages
 * Dark theme matching the landing page design system.
 */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

/* ── Design tokens ── */
:root {
    --blue:      #0077FF;
    --blue-dark: #0055cc;
    --blue-glow: rgba(0,119,255,.22);
    --bg:        #08090f;
    --bg2:       #0d0f1a;
    --surface:   rgba(255,255,255,.04);
    --border:    rgba(255,255,255,.08);
    --text:      #f0f2f8;
    --muted:     #8892a4;
    --green:     #00e676;
    --font:      'Manrope', system-ui, sans-serif;
}

/* ── Page shell ── */
*, *::before, *::after { box-sizing: border-box; }

.mcl-page-shell {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
}

/* ── Nav ── */
.mcl-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(8,9,15,.88);
    border-bottom: 1px solid var(--border);
}
.mcl-nav-in {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.mcl-nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 17px;
    color: var(--text);
    text-decoration: none;
}
.mcl-nav-logo-icon {
    width: 34px;
    height: 34px;
    background: var(--blue);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.mcl-nav-back {
    font-size: 13px;
    color: var(--muted);
    text-decoration: none;
    transition: color .2s;
}
.mcl-nav-back:hover { color: var(--text); }

/* ── Main content area ── */
.mcl-main {
    padding-top: 64px;
    min-height: calc(100vh - 64px - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.mcl-main::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 700px; height: 450px;
    background: radial-gradient(ellipse, rgba(0,119,255,.12), transparent 70%);
    pointer-events: none;
}

/* ── Buy page wrap ── */
.mcl-buy-wrap {
    max-width: 700px;
    width: 100%;
    padding: 60px 24px 80px;
    position: relative;
    z-index: 1;
}

/* ── Test mode banner ── */
.mcl-test-banner {
    background: rgba(245,158,11,.1);
    border: 1px solid rgba(245,158,11,.3);
    color: #fbbf24;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 24px;
    text-align: center;
}

/* ── Buy page title ── */
.mcl-buy-title {
    font-size: clamp(26px, 4vw, 40px);
    font-weight: 800;
    letter-spacing: -.02em;
    text-align: center;
    margin: 0 0 8px;
    color: var(--text);
}
.mcl-buy-sub {
    text-align: center;
    color: var(--muted);
    font-size: 16px;
    margin: 0 0 42px;
}

/* ── Plan cards grid ── */
.mcl-plans {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 32px;
}
.mcl-plan {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 22px;
    padding: 30px 24px;
    cursor: pointer;
    transition: border-color .2s, transform .2s, box-shadow .2s;
    position: relative;
    text-align: center;
}
.mcl-plan:hover {
    border-color: rgba(0,119,255,.4);
    transform: translateY(-3px);
}
.mcl-plan.selected {
    border-color: var(--blue);
    background: rgba(0,119,255,.07);
}
.mcl-plan-featured {
    border-color: var(--blue);
    box-shadow: 0 0 40px var(--blue-glow);
}
.mcl-plan-badge {
    position: absolute;
    top: -13px; left: 50%;
    transform: translateX(-50%);
    background: var(--blue);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 14px;
    border-radius: 20px;
    white-space: nowrap;
}
.mcl-plan-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-bottom: 14px;
}
.mcl-plan-price {
    font-size: 46px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -.03em;
    line-height: 1;
    margin-bottom: 4px;
}
.mcl-plan-period {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 22px;
}
.mcl-plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 26px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.mcl-plan-features li {
    font-size: 13px;
    color: var(--muted);
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.mcl-plan-features li::before {
    content: '✓';
    color: var(--green);
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── Buttons ── */
.mcl-plan-btn {
    width: 100%;
    padding: 12px 20px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, border-color .2s, transform .15s;
}
.mcl-plan-btn:hover {
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.2);
    transform: translateY(-1px);
}
.mcl-btn-primary {
    background: var(--blue) !important;
    border-color: var(--blue) !important;
    color: white !important;
    box-shadow: 0 4px 20px var(--blue-glow);
}
.mcl-btn-primary:hover {
    background: var(--blue-dark) !important;
    border-color: var(--blue-dark) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 28px var(--blue-glow) !important;
}

/* ── Checkout form ── */
.mcl-checkout {
    background: rgba(255,255,255,.03);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 30px 32px;
    animation: mclFadeIn .3s ease;
}
@keyframes mclFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.mcl-checkout-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 10px;
}
.mcl-checkout-summary {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 22px;
    padding: 10px 14px;
    background: rgba(0,119,255,.07);
    border-radius: 8px;
    border-left: 3px solid var(--blue);
}
.mcl-form-group {
    margin-bottom: 16px;
}
.mcl-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 8px;
}
.mcl-input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255,255,255,.06);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    transition: border-color .2s, background .2s;
    outline: none;
    box-sizing: border-box;
}
.mcl-input:focus {
    border-color: var(--blue);
    background: rgba(0,119,255,.05);
}
.mcl-input::placeholder { color: rgba(136,146,164,.5); }

/* ──────────────────────────────────────────────────────────────────────────
   Fix for WP wpautop() filter: it wraps HTML comments, whitespace AND
   inline-level tags like <button> in <p>s. These stray <p>s break the
   .mcl-plans grid layout and hide/disform <button>s in .mcl-checkout.

   Strategy:
     - Truly empty <p> (whitespace-only) → hide entirely so they don't
       consume grid cells or add vertical gaps.
     - <p> that wpautop wrapped around real content (e.g. a <button>) →
       `display: contents` so the <p> vanishes from layout, but its
       children render as if they were direct children of the parent.
   ────────────────────────────────────────────────────────────────────────── */
.mcl-buy-wrap p:empty,
.mcl-plans > p:empty,
.mcl-checkout > p:empty,
.mcl-form-group > p:empty,
.mcl-plan > p:empty {
    display: none !important;
}

.mcl-plans > p,
.mcl-checkout > p,
.mcl-form-group > p,
.mcl-plan > p {
    display: contents !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Forced to win over inline <style> blocks that duplicate these rules in page HTML */
.mcl-pay-btn {
    display: block !important;
    width: 100% !important;
    padding: 12px 20px !important;
    font-size: 15px !important;
    line-height: 1.25 !important;
    min-height: 0 !important;
    height: auto !important;
    border-radius: 10px !important;
    margin: 4px 0 10px !important;
    font-family: var(--font) !important;
    font-weight: 700 !important;
    text-align: center !important;
    transition: background .2s, transform .15s, box-shadow .15s;
    box-sizing: border-box !important;
}
.mcl-pay-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none !important;
}
.mcl-error {
    background: rgba(239,68,68,.1);
    border: 1px solid rgba(239,68,68,.3);
    color: #fca5a5;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 10px;
}
.mcl-secure-note {
    text-align: center;
    font-size: 12px;
    color: var(--muted);
    margin-top: 12px;
}

/* ── Footer ── */
.mcl-footer {
    border-top: 1px solid var(--border);
    padding: 22px 24px;
}
.mcl-footer-in {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.mcl-footer-copy { font-size: 13px; color: var(--muted); }
.mcl-footer-links { display: flex; gap: 20px; }
.mcl-footer-links a {
    font-size: 13px;
    color: var(--muted);
    text-decoration: none;
    transition: color .2s;
}
.mcl-footer-links a:hover { color: var(--text); }

/* ── Success page ── */
.mcl-success-wrap {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    padding: 80px 24px;
    position: relative;
    z-index: 1;
}
.mcl-success-icon {
    font-size: 72px;
    display: block;
    margin-bottom: 22px;
    animation: mclPop .5s cubic-bezier(.175,.885,.32,1.275) both;
}
@keyframes mclPop {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.mcl-success-wrap h2 {
    font-size: clamp(24px, 3.5vw, 36px);
    font-weight: 800;
    color: var(--text);
    margin: 0 0 12px;
    letter-spacing: -.02em;
}
.mcl-success-wrap p {
    font-size: 15px;
    color: var(--muted);
    margin: 0 0 8px;
}
.mcl-success-wrap p strong { color: var(--text); }
.mcl-success-steps {
    background: rgba(0,119,255,.06);
    border: 1px solid rgba(0,119,255,.2);
    border-radius: 16px;
    padding: 24px 28px;
    text-align: left;
    margin: 28px 0 24px;
}
.mcl-success-steps h3 {
    font-size: 11px;
    font-weight: 700;
    color: #93c5fd;
    margin: 0 0 16px;
    text-transform: uppercase;
    letter-spacing: .1em;
}
.mcl-success-steps ol {
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
}
.mcl-success-steps li {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.5;
}
.mcl-success-steps b { color: var(--text); }
.mcl-success-steps code {
    background: rgba(255,255,255,.08);
    padding: 2px 7px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #a5b4fc;
}
.mcl-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--blue);
    color: white;
    text-decoration: none;
    font-family: var(--font);
    font-weight: 700;
    font-size: 16px;
    padding: 14px 30px;
    border-radius: 12px;
    margin-top: 8px;
    box-shadow: 0 4px 24px var(--blue-glow);
    transition: background .2s, transform .15s, box-shadow .15s;
}
.mcl-download-btn:hover {
    background: var(--blue-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px var(--blue-glow);
    color: white;
    text-decoration: none;
}
.mcl-success-note {
    margin-top: 20px !important;
    font-size: 13px !important;
    color: rgba(136,146,164,.7) !important;
}
.mcl-success-note a { color: #60a5fa; }

/* ── Legal pages ── */
.mcl-legal-wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 100px 24px 80px;
}
.mcl-legal-wrap h1 {
    font-size: clamp(24px, 3.5vw, 38px);
    font-weight: 800;
    color: var(--text);
    letter-spacing: -.02em;
    margin: 0 0 8px;
}
.mcl-legal-date {
    font-size: 13px;
    color: var(--muted);
    margin: 0 0 40px;
    display: block;
}
.mcl-legal-wrap h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    margin: 36px 0 12px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}
.mcl-legal-wrap h2:first-of-type {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}
.mcl-legal-wrap p {
    font-size: 15px;
    color: var(--muted);
    line-height: 1.75;
    margin: 0 0 12px;
}
.mcl-legal-wrap a { color: #60a5fa; }

/* ── Support page ── */
.mcl-support-hero {
    text-align: center;
    margin-bottom: 48px;
}
.mcl-support-hero p {
    font-size: 17px;
    color: var(--muted);
    max-width: 460px;
    margin: 10px auto 0;
}
.mcl-contact-cards {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 48px;
}
.mcl-contact-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 24px 28px;
    display: flex;
    align-items: flex-start;
    gap: 18px;
    transition: border-color .2s, transform .2s;
}
.mcl-contact-card:hover {
    border-color: rgba(0,119,255,.3);
    transform: translateY(-2px);
}
.mcl-contact-icon { font-size: 30px; flex-shrink: 0; }
.mcl-contact-body h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 6px;
}
.mcl-contact-body p {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.6;
    margin: 0;
}
.mcl-contact-body a { color: #60a5fa; font-weight: 600; text-decoration: none; }
.mcl-contact-body a:hover { text-decoration: underline; }

.mcl-faq-section h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 20px;
}
.mcl-faq-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 22px;
    margin-bottom: 10px;
    transition: border-color .2s;
}
.mcl-faq-item:hover { border-color: rgba(0,119,255,.3); }
.mcl-faq-item h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 8px;
}
.mcl-faq-item p {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
    margin: 0;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .mcl-plans { grid-template-columns: 1fr; }
    .mcl-checkout { padding: 20px 16px; }
    .mcl-success-steps { padding: 18px 20px; }
    .mcl-footer-in { flex-direction: column; text-align: center; }
    .mcl-footer-links { justify-content: center; }
    .mcl-buy-wrap { padding: 40px 16px 60px; }
    .mcl-legal-wrap { padding: 80px 16px 60px; }
    .mcl-contact-card { flex-direction: column; gap: 12px; }
}
