/* ==========================================================================
   SNAM7 — Public website styles
   One stylesheet, no framework. Sections:
   1. Design tokens   2. Base   3. Layout   4. Components
   5. Header/Footer   6. Page sections   7. Mock screenshots   8. Responsive
   ========================================================================== */

/* 1. Design tokens ------------------------------------------------------- */
:root {
  --ink: #0b1530;          /* SNAM7 navy — headings, footer */
  --text: #2a3350;
  --muted: #6b7390;
  --line: #e3e7f0;
  --bg: #ffffff;
  --bg-alt: #f5f7fb;
  --primary: #2f5bff;      /* SNAM7 blue */
  --primary-dark: #1d3fd1;
  --accent: #12b5cb;       /* SNAM7 cyan */
  --success: #0f9d58;
  --danger: #d93025;
  --warning-bg: #fff6dd;
  --warning-ink: #7a5800;
  /* Product brand colour (overridden per product) */
  --brand: var(--primary);
  --brand-dark: var(--ink);
  --brand-soft: #eef2ff;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(11, 21, 48, .06), 0 8px 24px rgba(11, 21, 48, .06);
  --shadow-lg: 0 20px 50px rgba(11, 21, 48, .18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Khmer", Helvetica, Arial, sans-serif;
  --container: 1160px;
}

/* 2. Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.6; font-size: 16px; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.2vw, 3.2rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.45rem, 2.6vw, 2rem); }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1em; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.lead { font-size: 1.15rem; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { left: 1rem; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* 3. Layout -------------------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 820px; }
.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 680px; margin: 0 auto 44px; text-align: center; }
.section-head p { color: var(--muted); }
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--primary); margin-bottom: .8rem; }
.eyebrow-light { color: rgba(255,255,255,.75); margin-bottom: .2rem; }

/* 4. Components ---------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; padding: .7em 1.25em; border-radius: 10px; font-weight: 600; font-size: .95rem; border: 1.5px solid transparent; cursor: pointer; transition: background .15s, color .15s, border-color .15s, transform .15s; text-decoration: none !important; font-family: inherit; line-height: 1.2; }
.btn:hover { transform: translateY(-1px); }
.btn-lg { padding: .9em 1.6em; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-brand { background: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-dark); }
.btn-outline { border-color: var(--line); color: var(--ink); background: #fff; }
.btn-outline:hover { border-color: var(--ink); }
.btn-ghost { color: var(--ink); }
.btn-light { background: #fff; color: var(--ink); }
.btn-outline-light { border-color: rgba(255,255,255,.5); color: #fff; }
.btn-outline-light:hover { border-color: #fff; background: rgba(255,255,255,.08); }
button:disabled, fieldset:disabled .btn { opacity: .5; cursor: not-allowed; transform: none; }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: .25em .6em; border-radius: 6px; white-space: nowrap; }
.tag-demo { background: var(--warning-bg); color: var(--warning-ink); }
.tag-core { background: var(--brand-soft); color: var(--brand-dark); }
.tag-addon { background: var(--bg-alt); color: var(--muted); }
.demo-note { background: var(--warning-bg); color: var(--warning-ink); border-radius: var(--radius-sm); padding: .7em 1em; font-size: .9rem; margin: 0 0 28px; }
.demo-note .tag { background: rgba(122, 88, 0, .12); }
.chip-list { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip-list li { font-size: .82rem; background: var(--brand-soft); color: var(--brand-dark); padding: .3em .75em; border-radius: 999px; font-weight: 500; }
.check-list { list-style: none; padding: 0; margin: 0 0 1em; }
.check-list li { position: relative; padding-left: 1.7em; margin-bottom: .55em; }
.check-list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--success); font-weight: 700; }
.check-list li.excluded { color: var(--muted); }
.check-list li.excluded::before { content: "–"; color: var(--muted); }
.table { width: 100%; border-collapse: collapse; margin-bottom: 1.2em; font-size: .95rem; }
.table th, .table td { text-align: left; padding: .7em .5em; border-bottom: 1px solid var(--line); }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.alert { border-radius: var(--radius-sm); padding: 1em 1.2em; margin-bottom: 1.4em; }
.alert-info { background: #eef4ff; color: #22357a; }
.alert-success { background: #e8f6ee; color: #0b5d34; }
.alert-success h2 { color: inherit; font-size: 1.25rem; }

/* Forms */
.form .field { margin-bottom: 18px; display: flex; flex-direction: column; gap: 6px; }
.form label { font-weight: 600; font-size: .9rem; color: var(--ink); }
.form input, .form select, .form textarea { font: inherit; padding: .75em .9em; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); width: 100%; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(47, 91, 255, .15); }
.form fieldset { border: 0; padding: 0; margin: 0; }
.field.has-error input, .field.has-error textarea, .field.has-error select { border-color: var(--danger); }
.error-text { color: var(--danger); font-size: .85rem; }

/* Product mark (logo square) */
.product-mark { display: inline-grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 12px; background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; font-weight: 800; letter-spacing: .02em; }
.product-mark-lg { width: 68px; height: 68px; font-size: 1.4rem; border-radius: 16px; box-shadow: 0 0 0 3px rgba(255,255,255,.25); }

/* 5. Header / Footer ----------------------------------------------------- */
.demo-banner { background: var(--warning-bg); color: var(--warning-ink); text-align: center; font-size: .82rem; padding: .45em 1em; }
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.35rem; color: var(--ink); letter-spacing: .02em; text-decoration: none !important; }
.logo-accent { color: var(--primary); }
.logo-light { color: #fff; }
.logo-light .logo-accent { color: var(--accent); }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.site-nav ul a { display: block; padding: .5em .8em; border-radius: 8px; color: var(--text); font-weight: 500; font-size: .95rem; }
.site-nav ul a:hover { background: var(--bg-alt); text-decoration: none; }
.site-nav ul a[aria-current="page"] { color: var(--primary); background: #eef2ff; }
.nav-actions { display: flex; gap: 8px; }
.nav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-footer { background: var(--ink); color: rgba(255,255,255,.7); padding: 64px 0 28px; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.site-footer h3 { color: #fff; font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .5em; }
.site-footer a { color: rgba(255,255,255,.7); }
.site-footer a:hover { color: #fff; }
.footer-brand p { margin-top: 1em; max-width: 300px; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.12); font-size: .85rem; }
.site-footer .muted { color: rgba(255,255,255,.45); }

/* 6. Page sections ------------------------------------------------------- */
.hero { padding: 80px 0 90px; background: radial-gradient(1200px 500px at 85% -10%, #e4ebff 0%, transparent 60%), radial-gradient(800px 400px at -10% 110%, #e0f7fa 0%, transparent 60%); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.grad { background: linear-gradient(90deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0; }
.hero-points { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: .92rem; color: var(--muted); }
.hero-points li::before { content: "✓ "; color: var(--success); font-weight: 700; }
.hero-visual { position: relative; min-height: 400px; }
.hero-stack { position: absolute; width: 88%; }
.hero-stack-0 { top: 0; left: 0; z-index: 2; }
.hero-stack-1 { bottom: 0; right: 0; z-index: 1; transform: rotate(2deg); opacity: .96; }

.page-hero { padding: 72px 0 40px; text-align: center; background: linear-gradient(180deg, #f2f5ff 0%, #fff 100%); }
.page-hero .lead { max-width: 640px; margin-left: auto; margin-right: auto; }

.product-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--brand); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.product-card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.product-card-head h3 { margin: 0; font-size: 1.3rem; }
.product-card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--line); }
.price-from strong { color: var(--ink); font-size: 1.15rem; }
.coming-card { margin-top: 24px; text-align: center; border-style: dashed; box-shadow: none; }

.feature { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.section-alt .feature { background: #fff; }
.feature p { color: var(--muted); margin: 0; }
.feature .small { margin-top: .8em; color: var(--ink); }
.feature-icon { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: #eef2ff; color: var(--primary); font-weight: 700; margin-bottom: 14px; }
.feature-brand .feature-icon { background: var(--brand-soft); color: var(--brand); }

.steps { list-style: none; padding: 0; margin: 0 0 32px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; counter-reset: s; }
.steps li { position: relative; padding: 24px 18px; background: var(--bg-alt); border-radius: var(--radius); }
.steps b { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; margin-bottom: 12px; }
.steps p { color: var(--muted); font-size: .92rem; margin: 0; }

.cta { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; padding: 48px; border-radius: 22px; color: rgba(255,255,255,.85); background: linear-gradient(120deg, var(--ink) 0%, #1a2f7a 60%, var(--primary) 100%); }
.cta-brand { background: linear-gradient(120deg, var(--brand-dark), var(--brand)); }
.cta h2 { color: #fff; }
.cta p { margin: 0; }
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Product detail */
.product-hero { padding: 56px 0 72px; color: rgba(255,255,255,.85); background: radial-gradient(900px 500px at 90% 0%, var(--brand) 0%, transparent 65%), var(--brand-dark); }
.product-hero h1 { color: #fff; margin: 0; }
.product-hero .lead { color: #fff; font-size: 1.3rem; margin-top: 1em; }
.product-title { display: flex; align-items: center; gap: 18px; margin-top: 18px; }
.back-link { color: rgba(255,255,255,.75); font-size: .9rem; }
.back-link:hover { color: #fff; }
.hero-url { color: rgba(255,255,255,.7); }
.hero-url strong { color: #fff; }
.modules .card { box-shadow: none; }
.module-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.module-head h3 { margin: 0; }
.module p { color: var(--muted); margin: 0; }

/* Pricing */
.pricing-controls { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; margin-bottom: 32px; }
.segmented { display: inline-flex; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.segmented a, .segmented button { border: 0; background: none; font: inherit; font-weight: 600; font-size: .92rem; color: var(--muted); padding: .55em 1em; border-radius: 9px; cursor: pointer; text-decoration: none; }
.segmented .active { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.save { font-size: .72rem; color: var(--success); font-weight: 700; margin-left: 4px; }
.plan { position: relative; display: flex; flex-direction: column; }
.plan h2 { font-size: 1.4rem; margin-bottom: .2em; }
.plan-featured { border: 2px solid var(--brand); box-shadow: var(--shadow-lg); }
.plan-badge { position: absolute; top: -13px; left: 28px; background: var(--brand); color: #fff; font-size: .75rem; font-weight: 700; padding: .3em .8em; border-radius: 999px; }
.plan-price { margin: 8px 0 18px; display: flex; align-items: baseline; gap: 6px; }
.plan-price strong { font-size: 2.4rem; color: var(--ink); letter-spacing: -.02em; }
.plan-price strong.quote { font-size: 1.6rem; }
.plan-price span { color: var(--muted); }
.limits { list-style: none; padding: 14px 0; margin: 0 0 16px; display: flex; gap: 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.plan .check-list { flex: 1; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 20px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.faq details p { margin: 12px 0 0; color: var(--muted); }

/* Domains */
.domain-search { display: flex; gap: 10px; max-width: 600px; margin: 28px auto 0; background: #fff; padding: 8px; border-radius: 14px; box-shadow: var(--shadow-lg); }
.domain-search input { flex: 1; border: 0; font: inherit; font-size: 1.05rem; padding: .6em .8em; min-width: 0; }
.domain-search input:focus { outline: none; }
.search-result { max-width: 600px; margin: 20px auto 0; padding: 20px; border-radius: var(--radius); text-align: left; }
.search-result.info { background: #eef4ff; color: #22357a; }
.search-result.error { background: #fdecea; color: #8a1c13; }

/* About / contact / auth */
.about-grid h2 { margin-top: .5em; }
.values dt { font-weight: 700; color: var(--ink); margin-top: 1em; }
.values dd { margin: .2em 0 0; color: var(--muted); }
.stats { margin-top: 12px; }
.stat { text-align: center; background: #fff; border-radius: var(--radius); padding: 28px; border: 1px solid var(--line); }
.stat strong { display: block; font-size: 2.2rem; color: var(--primary); }
.stat span { color: var(--muted); }
.grid-contact { grid-template-columns: 1.4fr 1fr; align-items: start; }
.contact-info dt { font-weight: 700; color: var(--ink); margin-top: 1em; }
.contact-info dd { margin: .2em 0 0; }
.auth-section { min-height: 60vh; display: flex; align-items: center; }
.auth-wrap { max-width: 480px; }
.auth-card h1 { font-size: 1.7rem; }

/* 7. Mock screenshots (image placeholders) ------------------------------ */
.mock-window { margin: 0; background: #fff; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid rgba(11,21,48,.08); position: relative; }
.mock-bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; background: #f1f3f8; border-bottom: 1px solid var(--line); }
.mock-bar span { width: 10px; height: 10px; border-radius: 50%; background: #d5d9e4; }
.mock-bar em { font-style: normal; font-size: .72rem; color: var(--muted); margin-left: 10px; background: #fff; padding: 2px 10px; border-radius: 6px; }
.mock-body { display: grid; grid-template-columns: 30% 1fr; min-height: 210px; }
.mock-side { background: var(--brand-dark); padding: 14px 10px; display: flex; flex-direction: column; gap: 6px; }
.mock-side b { color: #fff; font-size: .85rem; margin-bottom: 6px; }
.mock-side i { font-style: normal; font-size: .68rem; color: rgba(255,255,255,.65); padding: 4px 8px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mock-side i.on { background: var(--brand); color: #fff; }
.mock-main { padding: 14px; display: flex; flex-direction: column; gap: 12px; background: #fbfcfe; }
.mock-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mock-stats div { height: 34px; border-radius: 6px; background: var(--brand-soft); }
.mock-chart { display: flex; align-items: flex-end; gap: 6px; height: 70px; padding: 6px; background: #fff; border-radius: 6px; border: 1px solid var(--line); }
.mock-chart span { flex: 1; background: var(--brand); border-radius: 3px 3px 0 0; opacity: .8; }
.mock-rows div { height: 9px; border-radius: 4px; background: #e9ecf3; margin-bottom: 7px; }
.mock-rows div:nth-child(2) { width: 80%; }
.mock-rows div:nth-child(3) { width: 60%; }
.placeholder-label { position: absolute; right: 8px; bottom: 8px; font-size: .68rem; background: rgba(11,21,48,.78); color: #fff; padding: 3px 8px; border-radius: 6px; max-width: calc(100% - 16px); }

/* 8. Responsive ---------------------------------------------------------- */
@media (max-width: 1020px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { min-height: 0; display: grid; }
  .hero-stack { position: static; width: 100%; transform: none !important; }
  .hero-stack-1 { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 70px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 12px; background: #fff; padding: 16px 24px 24px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg); }
  .nav-open .site-nav { display: flex; }
  .site-nav ul { flex-direction: column; }
  .site-nav ul a { padding: .8em .6em; }
  .nav-actions .btn { flex: 1; }
  .grid-3, .grid-contact { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .section { padding: 60px 0; }
}

@media (max-width: 560px) {
  .container { padding: 0 18px; }
  .grid-4, .steps, .footer-grid { grid-template-columns: 1fr; }
  .cta { padding: 32px 24px; }
  .pricing-controls { flex-direction: column; align-items: stretch; }
  .segmented { justify-content: center; }
  .domain-search { flex-direction: column; }
  .card { padding: 22px; }
  .hero { padding: 48px 0 56px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* Fixes ------------------------------------------------------------------ */
[hidden] { display: none !important; }
/* Let grid children shrink below their content width (prevents mobile overflow) */
.grid > *, .hero-grid > *, .mock-body > * { min-width: 0; }
.plans + .small { margin-top: 28px; }
html, body { overflow-x: hidden; }
