/* Calendaria Duastella website — palette mirrors the app's theme (lib/theme/). */
:root {
  --bg: #0d0f1e;
  --surface: #151829;
  --surface-high: #1e2240;
  --violet: #7c6ff7;
  --violet-dim: #3d3880;
  --teal: #2ec4b6;
  --amber: #ffc857;
  --error: #ff6b6b;
  --success: #4ade80;
  --on-bg: #e8eaf6;
  --on-surface: #b0b4d0;
  --outline: #2e3258;
  --radius: 16px;
  --max-width: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--on-bg);
  line-height: 1.6;
}

a { color: var(--violet); }

img, svg { max-width: 100%; }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(13, 15, 30, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--outline);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--on-bg);
  text-decoration: none;
}

.brand img { width: 28px; height: 28px; }

.site-nav {
  display: flex;
  gap: 20px;
}

.site-nav a {
  color: var(--on-surface);
  text-decoration: none;
  font-size: 0.95rem;
}

.site-nav a:hover { color: var(--on-bg); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Language switcher (filled by js/i18n.js) */
.lang-switcher {
  background: var(--surface);
  color: var(--on-bg);
  border: 1px solid var(--outline);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.lang-switcher:hover,
.lang-switcher:focus { border-color: var(--violet); }

/* Hides a non-English page until js/i18n.js has translated it. */
html.i18n-pending body { visibility: hidden; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

.btn-primary { background: var(--violet); color: #fff; }
.btn-primary:hover { background: #6a5cf0; }

.btn-secondary {
  background: transparent;
  color: var(--on-bg);
  border-color: var(--outline);
}
.btn-secondary:hover { border-color: var(--violet); }

.btn[disabled], .btn[aria-busy="true"] { opacity: 0.6; cursor: wait; }

.btn-block { width: 100%; }

/* Hero */
.hero {
  padding: 96px 0 72px;
  text-align: center;
  background:
    radial-gradient(600px 300px at 50% 0%, rgba(124, 111, 247, 0.25), transparent),
    var(--bg);
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 1.15;
  margin: 0 0 20px;
}

.hero h1 .accent { color: var(--violet); }

.hero p.lead {
  max-width: 640px;
  margin: 0 auto 32px;
  color: var(--on-surface);
  font-size: 1.15rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* Sections */
section { padding: 72px 0; }

.section-title {
  text-align: center;
  font-size: clamp(1.7rem, 3.5vw, 2.3rem);
  margin: 0 0 12px;
}

.section-subtitle {
  text-align: center;
  color: var(--on-surface);
  max-width: 620px;
  margin: 0 auto 48px;
}

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--radius);
  padding: 24px;
}

.card h3 { margin: 12px 0 8px; font-size: 1.15rem; }
.card p { margin: 0; color: var(--on-surface); }

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--violet-dim);
  font-size: 1.4rem;
}

/* How it works */
.steps { counter-reset: step; }

.steps .card::before {
  counter-increment: step;
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--teal);
  color: var(--bg);
  font-weight: 700;
}

/* Pricing */
.pricing { background: var(--surface); border-top: 1px solid var(--outline); border-bottom: 1px solid var(--outline); }

.plans {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: stretch;
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--outline);
  border-radius: var(--radius);
  padding: 28px 24px;
}

.plan.featured { border-color: var(--violet); box-shadow: 0 0 0 1px var(--violet); }

.plan .badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--amber);
  color: var(--bg);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.plan h3 { margin: 0 0 8px; font-size: 1.2rem; }

.plan .price { font-size: 2.2rem; font-weight: 800; margin: 0; }
.plan .price small { font-size: 1rem; font-weight: 500; color: var(--on-surface); }

.plan .detail { color: var(--on-surface); margin: 4px 0 20px; }

.plan ul {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  flex: 1;
}

.plan li { padding: 6px 0 6px 26px; position: relative; color: var(--on-surface); }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--teal); font-weight: 700; }

.checkout-email {
  max-width: 420px;
  margin: 0 auto 40px;
  text-align: center;
}

.checkout-email label { display: block; color: var(--on-surface); margin-bottom: 8px; font-size: 0.95rem; }

.input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--outline);
  background: var(--bg);
  color: var(--on-bg);
  font: inherit;
}

.input:focus { outline: none; border-color: var(--violet); }

.notice {
  max-width: 620px;
  margin: 24px auto 0;
  padding: 12px 16px;
  border-radius: 12px;
  text-align: center;
}

.notice[hidden] { display: none; }
.notice.error { background: rgba(255, 107, 107, 0.12); border: 1px solid var(--error); color: var(--error); }
.notice.info { background: rgba(124, 111, 247, 0.12); border: 1px solid var(--violet); color: var(--on-bg); }

.fine-print { text-align: center; color: var(--on-surface); font-size: 0.9rem; margin-top: 24px; }

/* Download */
.download { text-align: center; }

.store-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* FAQ */
.faq { max-width: 760px; margin: 0 auto; }

.faq details {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 12px;
}

.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { color: var(--on-surface); margin: 12px 0 0; }

/* Status pages (success / cancel / 404) */
.status-page {
  min-height: calc(100vh - 64px - 96px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 0;
}

.status-card {
  max-width: 520px;
  width: 100%;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--radius);
  padding: 40px 32px;
}

.status-icon { font-size: 3rem; line-height: 1; margin-bottom: 16px; }
.status-card h1 { margin: 0 0 12px; font-size: 1.8rem; }
.status-card p { color: var(--on-surface); margin: 0 0 16px; }
.status-card .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 24px; }

.status-line[data-state="ok"] { color: var(--success); }
.status-line[data-state="pending"] { color: var(--amber); }
.status-line[data-state="error"] { color: var(--error); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--outline);
  padding: 32px 0;
  color: var(--on-surface);
  font-size: 0.9rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

.site-footer a { color: var(--on-surface); }

/* Every language version, as plain links (crawlable, unlike the select). */
.site-footer .lang-links {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 0.8rem;
}
.site-footer .lang-links a { opacity: 0.75; }
.site-footer .lang-links a[aria-current] { opacity: 1; font-weight: 600; }

@media (max-width: 640px) {
  .site-nav { display: none; }
  .header-actions .btn { padding: 8px 14px; font-size: 0.9rem; }
  .lang-switcher { max-width: 8.5rem; }
  .hero { padding: 64px 0 48px; }
  section { padding: 56px 0; }
}
