/* ===========================================================
   Panda Cloud — landing page styles
   ===========================================================
   Design tokens at the top — change colors / brand here, NOT
   in the section rules. Want to rebrand for a clone deploy?
   Edit the :root block, replace the SVG logos in index.html,
   you're done.
   =========================================================== */

:root {
    /* Brand — bamboo green primary per BRAND.md */
    --brand-primary: #2D7A3E;        /* panda-green-700 */
    --brand-primary-bright: #3F8F46; /* panda-green-500 */
    --brand-accent: #10b981;          /* mint green accent */

    /* Neutrals */
    --fg: #0f172a;
    --fg-muted: #475569;
    --fg-soft: #94a3b8;
    --bg: #ffffff;
    --bg-soft: #f8fafc;
    --bg-card: #ffffff;
    --border: #e2e8f0;

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei",
        sans-serif;
    --font-display: var(--font-sans);

    /* Layout */
    --container: 1120px;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, .08);
    --shadow-lg: 0 12px 40px rgba(15, 23, 42, .12);
}

@media (prefers-color-scheme: dark) {
    :root {
        --fg: #f8fafc;
        --fg-muted: #cbd5e1;
        --fg-soft: #64748b;
        --bg: #0b0f1c;
        --bg-soft: #111827;
        --bg-card: #131b2e;
        --border: #1e293b;
        --brand-primary: #7FB885;        /* panda-green-300, lighter for dark bg */
        --brand-primary-bright: #3F8F46; /* panda-green-500 */
    }
}

/* Reset + base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--fg);
    background: var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-primary); text-decoration: none; }
a:hover { color: var(--brand-primary-bright); }
button { font-family: inherit; }

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}
.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform .12s ease, background .12s ease, border-color .12s ease;
    text-decoration: none;
    line-height: 1.2;
}
.btn:hover { transform: translateY(-1px); }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-block { display: flex; width: 100%; }
.btn-primary {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}
.btn-primary:hover { background: var(--brand-primary-bright); border-color: var(--brand-primary-bright); color: #fff; }
.btn-ghost {
    background: transparent;
    color: var(--fg);
    border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-soft); color: var(--fg); }

/* ============ NAV ============ */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, .85);
    backdrop-filter: saturate(140%) blur(12px);
    border-bottom: 1px solid var(--border);
}
@media (prefers-color-scheme: dark) {
    .nav { background: rgba(11, 15, 28, .85); }
}
.nav-row {
    display: flex;
    align-items: center;
    gap: 24px;
    padding-top: 14px;
    padding-bottom: 14px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 16px;
    color: var(--fg);
}
.brand-logo {
    width: 28px;
    height: 28px;
    color: var(--brand-primary);
}
.nav-links {
    display: flex;
    gap: 24px;
    margin-left: auto;
    margin-right: 12px;
}
.nav-links a {
    color: var(--fg-muted);
    font-weight: 500;
    font-size: 14px;
}
.nav-links a:hover { color: var(--fg); }
.nav-cta { display: flex; gap: 8px; }
@media (max-width: 720px) {
    .nav-links { display: none; }
}

/* ============ HERO ============ */
.hero {
    padding: 64px 0 96px;
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 48px;
    align-items: center;
}
.hero-text h1 {
    font-size: clamp(36px, 5.5vw, 56px);
    line-height: 1.05;
    margin: 0 0 16px;
    letter-spacing: -.02em;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-bright));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-sub {
    font-size: 18px;
    color: var(--fg-muted);
    margin: 0 0 28px;
    max-width: 540px;
}
.hero-ctas {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}
.hero-trust {
    display: flex;
    gap: 24px;
    color: var(--fg-muted);
    font-size: 14px;
    flex-wrap: wrap;
}
.hero-trust strong { color: var(--fg); }
.hero-art { color: var(--brand-primary); max-width: 360px; justify-self: center; }
@media (max-width: 880px) {
    .hero-grid { grid-template-columns: 1fr; }
    .hero-art { display: none; }
    .hero { padding: 48px 0 64px; }
}

/* ============ Section heads ============ */
section { padding: 80px 0; }
section h2 {
    font-size: clamp(28px, 3.6vw, 40px);
    line-height: 1.15;
    margin: 0 0 12px;
    letter-spacing: -.015em;
}
.section-sub {
    color: var(--fg-muted);
    font-size: 17px;
    margin: 0 0 40px;
    max-width: 640px;
}

/* ============ PLANS ============ */
.plans { background: var(--bg); }
.plans-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.plan-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.plan-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand-primary);
}
.plan-popular {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-md);
}
.plan-popular-badge {
    position: absolute;
    top: -10px; left: 50%;
    transform: translateX(-50%);
    background: var(--brand-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 999px;
}
.plan-tier {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--brand-primary);
}
.plan-price {
    margin: 14px 0 8px;
    display: flex;
    align-items: flex-start;
    gap: 4px;
}
.plan-price .ccy { font-size: 20px; padding-top: 8px; color: var(--fg-muted); }
.plan-price .amt { font-size: 48px; font-weight: 700; line-height: 1; }
.plan-price .per { font-size: 14px; color: var(--fg-muted); padding-top: 24px; }
/* Annual pricing line + savings hint — rendered by main.js when the API
   returns a multi-duration product set per tier. Stays hidden if a tier
   has no annual option. */
.plan-price-annual {
    font-size: 13px;
    color: var(--fg-muted);
    margin: -4px 0 2px;
    line-height: 1.3;
}
.plan-price-savings {
    font-size: 12px;
    font-weight: 600;
    color: #10b981;
    margin: 0 0 8px;
    line-height: 1.3;
}
.plan-feats {
    list-style: none;
    padding: 0;
    margin: 24px 0;
    flex: 1;
}
.plan-feats li {
    padding: 8px 0;
    color: var(--fg-muted);
    font-size: 14px;
    display: flex;
    gap: 8px;
}
.plan-feats li::before {
    content: "✓";
    color: var(--brand-accent);
    font-weight: 700;
}
.plans-note { color: var(--fg-soft); font-size: 14px; margin-top: 24px; text-align: center; }
.plans-reassure { color: var(--fg-muted); font-size: 14px; margin-top: 8px; text-align: center; }
@media (max-width: 880px) {
    .plans-grid { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; }
}

/* ============ NETWORK / GLOBAL MAP ============ */
.network { background: var(--bg); }
.network h2 { text-align: center; }
/* Center the subline as a block too — base .section-sub has max-width: 640px
   without margin auto, which keeps it left-aligned even with text-align center. */
.network .section-sub { text-align: center; margin-left: auto; margin-right: auto; }
.map-wrap {
    position: relative;
    margin: 32px auto 0;
    max-width: 720px;
    aspect-ratio: 600 / 280;
    color: var(--brand-primary);
}
.map-bg {
    width: 100%;
    height: 100%;
    display: block;
}
.ping-markers {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.ping {
    position: absolute;
    width: 14px;
    height: 14px;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    cursor: default;
}
.ping::after {
    content: '';
    position: absolute;
    inset: 4px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, .25), 0 0 8px rgba(16, 185, 129, .55);
    z-index: 2;
}
.ping-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(16, 185, 129, .35);
    transform: scale(.4);
    opacity: .8;
    animation: pingExpand 2.4s cubic-bezier(.2, .8, .3, 1) infinite;
}
.ping:nth-child(2n) .ping-ring { animation-delay: 0.4s; }
.ping:nth-child(3n) .ping-ring { animation-delay: 0.8s; }
.ping:nth-child(5n) .ping-ring { animation-delay: 1.2s; }
.ping:nth-child(7n) .ping-ring { animation-delay: 1.6s; }
@keyframes pingExpand {
    0%   { transform: scale(.4); opacity: .65; }
    70%  { transform: scale(2.6); opacity: 0; }
    100% { transform: scale(2.6); opacity: 0; }
}
.ping-label {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 700;
    color: var(--fg-muted);
    background: var(--bg);
    padding: 1px 4px;
    border-radius: 3px;
    white-space: nowrap;
    opacity: .85;
}
@media (prefers-reduced-motion: reduce) {
    .ping-ring { animation: none; opacity: 0; }
}
.map-pills {
    display: none;
    margin-top: 24px;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
.map-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--fg-muted);
    font-size: 13px;
    font-weight: 500;
}
.map-pill-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 4px rgba(16, 185, 129, .55);
    flex-shrink: 0;
}
@media (max-width: 720px) {
    /* On phones, the map gets cramped (labels overlap, dots too close).
       Hide the map and show the country-pill list instead. */
    .map-wrap { display: none; }
    .map-pills { display: flex; }
}

/* ============ DEVICES ============ */
.devices { background: var(--bg-soft); }
.devices .store-link { margin: 28px 0 0; text-align: center; }
.device-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-top: 24px;
}
.device {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--fg-muted);
    font-size: 13px;
    font-weight: 500;
    transition: transform .12s, color .12s;
}
.device:hover { transform: translateY(-2px); color: var(--fg); }
.device svg { width: 32px; height: 32px; }
@media (max-width: 720px) {
    .device-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============ ROUTER / WHOLE-HOME ============ */
.router { background: var(--bg); }
.router-card {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 40px;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-sm);
}
.router-text h2 { text-align: left; }
.router-text .section-sub { margin-bottom: 20px; }
.router-feats { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 10px; }
.router-feats li {
    position: relative;
    padding-left: 26px;
    color: var(--fg-muted);
    font-size: 15px;
}
.router-feats li::before {
    content: "✓";
    position: absolute; left: 0; top: 0;
    color: var(--brand-primary);
    font-weight: 700;
}
.router-note { color: var(--fg-soft); font-size: 13px; line-height: 1.6; margin: 0 0 22px; max-width: 560px; }
.router-ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.router-art { display: flex; justify-content: center; align-items: center; color: var(--brand-primary); }
.router-art svg { width: 100%; max-width: 240px; height: auto; }
@media (max-width: 820px) {
    .router-card { grid-template-columns: 1fr; padding: 28px; gap: 24px; }
    .router-art { order: -1; }
    .router-art svg { max-width: 170px; }
}

/* ============ WHY US ============ */
.why { background: var(--bg); }
.why-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.why-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}
.why-icon { font-size: 32px; margin-bottom: 12px; }
.why-card h3 { font-size: 17px; margin: 0 0 8px; }
.why-card p { color: var(--fg-muted); font-size: 14px; margin: 0; }
@media (max-width: 880px) {
    .why-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
    .why-grid { grid-template-columns: 1fr; }
}

/* ============ FAQ ============ */
.faq { background: var(--bg-soft); }
.faq-list { max-width: 760px; }
details {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 12px;
}
details summary {
    cursor: pointer;
    font-weight: 600;
    padding: 4px 0;
    list-style: none;
    position: relative;
    padding-right: 28px;
}
details summary::-webkit-details-marker { display: none; }
details summary::after {
    content: "+";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    color: var(--fg-soft);
    transition: transform .15s;
}
details[open] summary::after { content: "−"; }
details > div {
    color: var(--fg-muted);
    font-size: 15px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* ============ CTA ============ */
.cta {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-bright));
    color: #fff;
    padding: 56px 0;
}
.cta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}
.cta h2 { color: #fff; margin: 0 0 8px; }
.cta p { color: rgba(255, 255, 255, .85); margin: 0; }
.cta .btn-primary {
    background: #fff;
    color: var(--brand-primary);
    border-color: #fff;
}
.cta .btn-primary:hover { background: rgba(255, 255, 255, .9); color: var(--brand-primary); }
@media (max-width: 720px) {
    .cta-row { flex-direction: column; align-items: flex-start; }
}

/* ============ FOOTER ============ */
.footer {
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 32px 0;
    color: var(--fg-muted);
    font-size: 14px;
}
.footer-row {
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    gap: 24px;
    align-items: center;
}
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--fg);
    font-weight: 600;
}
.footer-links {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}
.footer-links a { color: var(--fg-muted); }
.footer-links a:hover { color: var(--fg); }
/* Payment icons row — reassures users we accept their preferred method.
   Pure CSS pills (no SVG dependency); dark mode tunes via prefers-color-scheme.
   Each .pay-icon is brand-colored to be recognizable at small sizes. */
.footer-payments {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 12px;
}
.footer-payments-label {
    color: var(--fg-muted);
    font-size: 11px;
    margin-right: 4px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.pay-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .5px;
    color: #fff;
    user-select: none;
    line-height: 1;
}
.pay-visa     { background: #1a1f71; }
.pay-mc       { background: linear-gradient(90deg, #eb001b 50%, #f79e1b 50%); }
/* Apple Pay: black pill with the Apple symbol prefix (rendered via ::before)
   so the visible text "Pay" reads as "Pay" with Apple's mark to its left. */
.pay-applepay { background: #000; padding-left: 4px; }
.pay-applepay::before {
    content: '\f8ff'; /* Apple logo glyph in macOS/iOS system fonts */
    font-family: -apple-system, BlinkMacSystemFont, 'Apple Color Emoji', sans-serif;
    margin-right: 2px;
    font-size: 12px;
    line-height: 1;
}
.pay-paypal   { background: #003087; }
.pay-up       { background: #d12128; }
.pay-alipay   { background: #1677ff; }
.pay-wechat   { background: #07c160; }

.footer-lang select {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--fg);
    font-size: 14px;
    cursor: pointer;
}

/* Hero secondary tagline (shown under the primary CTAs). */
.hero-tagline {
    margin: 16px 0 0;
    color: var(--fg-soft);
    font-size: 13px;
    font-weight: 500;
}
.footer-copy { color: var(--fg-soft); font-size: 13px; }
@media (max-width: 720px) {
    .footer-row {
        grid-template-columns: 1fr;
        gap: 16px;
        text-align: left;
    }
}
