/* LinguaSphere marketing site — shared stylesheet
   Brand: teal primary (#00BFA6), gradient (#00BFA6 → #64D8CB).
   Mirrors the app's design system (frontend/src/theme/index.js).
*/

:root {
  --color-primary: #00BFA6;
  --color-primary-light: #64D8CB;
  --color-primary-dark: #00786B;    /* Darkened from #00897B for WCAG AA 4.5:1 text contrast on white */
  --color-primary-darker: #005C52;  /* Hover/active state for primary-dark surfaces */
  --color-text: #1A1A2E;
  --color-text-secondary: #5C6670;
  --color-text-tertiary: #66707A;   /* Darkened from #8E99A4 for WCAG AA 4.5:1 contrast on #FAFBFC backgrounds */
  --color-background: #FAFBFC;
  --color-surface: #FFFFFF;
  --color-border: #E8ECF0;
  --color-divider: #F0F2F5;
  --gradient-primary: linear-gradient(135deg, #00BFA6 0%, #64D8CB 100%);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);

  --font-stack: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-stack);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-background);
}

a { color: var(--color-primary-dark); text-decoration: none; }
a:hover { color: var(--color-primary-darker); text-decoration: underline; }

/* Inline links inside body text must be distinguishable from the
   surrounding text by more than color alone (WCAG SC 1.4.1). Adding
   `text-decoration: underline` to links inside <p> elements covers
   the common inline-link case; nav, brand, and button links live
   outside <p> and are unaffected. */
p a { text-decoration: underline; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Header ─────────────────────────────────────────── */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-divider);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand:hover { text-decoration: none; }

.brand-logo {
  height: 56px;
  width: auto;
  display: block;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 15px;
  font-weight: 500;
}
.header-nav a { color: var(--color-text-secondary); }
.header-nav a:hover { color: var(--color-primary-dark); text-decoration: none; }

/* Language switcher — pill-style, inactive state for the unfinished
   Spanish locale gets a subtle dot indicator */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-full, 999px);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--color-text-tertiary);
}
.lang-switch .lang-active {
  color: var(--color-text);
}
.lang-switch .lang-link {
  color: var(--color-text-tertiary);
  text-decoration: none;
}
.lang-switch .lang-link:hover {
  color: var(--color-primary-dark);
  text-decoration: none;
}
.lang-switch .lang-link::before {
  content: "·";
  margin-right: 4px;
  color: var(--color-divider);
}

/* ─── Hero ───────────────────────────────────────────── */
.hero {
  background: var(--gradient-primary);
  color: var(--color-text);
  padding: 80px 0 72px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 56px;
  align-items: center;
}

.hero-text {
  max-width: 560px;
}

.hero h1 {
  font-size: 46px;
  font-weight: 800;
  line-height: 1.12;
  margin-bottom: 20px;
  color: var(--color-text);
}

.hero-sub {
  font-size: 18px;
  line-height: 1.6;
  margin: 0 0 32px;
  color: var(--color-text);
  opacity: 0.85;
}

.hero-meta {
  margin-top: 22px;
  font-size: 14px;
  color: var(--color-text);
  opacity: 0.7;
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.phone-frame {
  width: 100%;
  max-width: 280px;
  border-radius: 28px;
  overflow: hidden;
  background: #000;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.12),
    0 24px 48px rgba(0, 0, 0, 0.18);
  transform: rotate(2deg);
  transition: transform 0.4s ease;
}
.phone-frame:hover { transform: rotate(0deg); }

/* Gallery uses upright phone frames, smaller, no tilt */
.phone-frame-static {
  transform: none;
  max-width: 220px;
  border-radius: 22px;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.08),
    0 12px 28px rgba(0, 0, 0, 0.10);
}
.phone-frame-static:hover { transform: none; }

.phone-screenshot {
  display: block;
  width: 100%;
  height: auto;
}

.cta-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Notify-me-at-launch form — replaces the old mailto button. */
.notify-form {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 520px;
  margin: 0 auto;
}
.notify-input {
  flex: 1 1 240px;
  min-width: 200px;
  padding: 12px 16px;
  font-size: 16px;
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  transition: border-color 0.15s ease;
}
.notify-input:focus {
  outline: none;
  border-color: var(--color-primary);
}
.notify-submit {
  flex: 0 0 auto;
}
@media (max-width: 480px) {
  .notify-form { flex-direction: column; }
  .notify-submit { width: 100%; }
}

.hero .cta-row {
  justify-content: flex-start;
}

.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  border: 2px solid transparent;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn.disabled,
.btn[aria-disabled="true"] {
  opacity: 0.65;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--color-surface);
  color: var(--color-primary-dark);
}
.btn-primary:hover { box-shadow: var(--shadow-md); }

.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border-color: rgba(26, 26, 46, 0.45);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.35);
  border-color: var(--color-text);
}

/* Official Google Play badge (replaces the text CTA button). The badge PNG
   has built-in clear space, so ~56px height renders a button comparable to
   the .btn elements it sits beside. */
.play-badge {
  display: inline-flex;
  align-items: center;
  align-self: center;
  line-height: 0;
  transition: transform 0.15s ease;
}
.play-badge:hover { transform: translateY(-1px); }
.play-badge img { height: 56px; width: auto; display: block; }
@media (max-width: 600px) {
  .play-badge img { height: 52px; }
}

/* Outside hero — solid primary buttons. Uses primary-dark (not primary)
   so the white text passes WCAG AA 4.5:1 contrast on the button bg. */
.features .btn-primary,
.pricing .btn-primary,
.download .btn-primary {
  background: var(--color-primary-dark);
  color: #FFFFFF;
}
.features .btn-primary:hover,
.pricing .btn-primary:hover,
.download .btn-primary:hover { background: var(--color-primary-darker); }

/* ─── Sections ───────────────────────────────────────── */
section {
  padding: 80px 0;
}
section h2 {
  font-size: 36px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
  color: var(--color-text);
}
.section-sub {
  text-align: center;
  font-size: 17px;
  color: var(--color-text-secondary);
  max-width: 620px;
  margin: 0 auto 56px;
}

/* ─── Features ───────────────────────────────────────── */
.features { background: var(--color-surface); }

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

.feature-card {
  position: relative;
  padding: 32px;
  border-radius: var(--radius-lg);
  background: var(--color-background);
  border: 1px solid var(--color-divider);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

/* Coming-soon variant. Used to fade the whole card to 0.85 opacity,
   but that drops every child's effective contrast below WCAG AA. The
   "Coming soon" badge + desaturated icon are sufficient visual cues. */
.feature-card-coming-soon .feature-icon { filter: saturate(0.8); }

.coming-soon-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--color-primary-dark);
  background: #FFFFFF;
  border: 1px solid rgba(0, 120, 107, 0.5);
  padding: 4px 10px;
  border-radius: var(--radius-full, 999px);
}
.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-light);
}
.feature-icon {
  font-size: 40px;
  margin-bottom: 16px;
  line-height: 1;
}
.feature-card h3 {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 10px;
}
.feature-card p {
  color: var(--color-text-secondary);
  font-size: 15px;
  line-height: 1.6;
}

/* ─── Gallery (See it in action) ─────────────────────── */
.gallery {
  background: var(--color-background);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  align-items: start;
}

.gallery-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 0;
}

.gallery-item figcaption {
  margin-top: 18px;
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  max-width: 220px;
}

@media (max-width: 980px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 36px; }
}

@media (max-width: 540px) {
  .gallery-grid { grid-template-columns: 1fr; gap: 36px; }
}

/* ─── Pricing ────────────────────────────────────────── */
.pricing { background: var(--color-background); }

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  max-width: 960px;
  margin: 0 auto;
}

.plan {
  padding: 36px 28px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-divider);
  position: relative;
}

.plan h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}
.plan .price {
  font-size: 36px;
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 24px;
}
.plan .price-period {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-tertiary);
}
.plan ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.plan li {
  font-size: 15px;
  color: var(--color-text-secondary);
  padding-left: 24px;
  position: relative;
}
.plan li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--color-primary-dark);
  font-weight: 700;
}

.plan-featured {
  border: 2px solid var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}
.plan-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary-dark);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
}

.pricing-note {
  text-align: center;
  font-size: 13px;
  color: var(--color-text-tertiary);
  margin-top: 32px;
}

/* ─── Download ───────────────────────────────────────── */
.download {
  background: var(--color-surface);
  text-align: center;
}
.download-note {
  font-size: 13px;
  color: var(--color-text-tertiary);
  margin-top: 18px;
}

/* ─── Devlog / Substack subscribe ────────────────────── */
.devlog {
  background: var(--color-background);
  text-align: center;
}
.devlog-embed {
  max-width: 480px;
  margin: 28px auto 0;
}
.devlog-embed iframe {
  width: 100%;
  min-height: 320px;
  border: 1px solid #E5E7EB;
  border-radius: var(--radius-md);
  background: #FFFFFF;
}
.footer-devlog {
  color: var(--color-primary-light);
  text-decoration: none;
}
.footer-devlog:hover { text-decoration: underline; }

/* ─── Footer ─────────────────────────────────────────── */
.site-footer {
  background: var(--color-text);
  color: #FFFFFF;
  padding: 56px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand {
  color: #FFFFFF;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}
.footer-tagline {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  max-width: 280px;
}

.site-footer h3 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 16px;
}

.site-footer ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.site-footer li a {
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
}
.site-footer li a:hover {
  color: #FFFFFF;
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 20px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
}

/* ─── Spanish placeholder page ────────────────────────── */
.es-placeholder {
  background: var(--gradient-primary);
  color: var(--color-text);
  padding: 96px 0;
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
}

.es-placeholder-inner {
  text-align: center;
  max-width: 720px;
}

.es-placeholder-badge {
  position: static;
  display: inline-block;
  margin-bottom: 24px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 137, 123, 0.5);
}

.es-placeholder h1 {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  color: var(--color-text);
}

.es-placeholder-sub {
  font-size: 17px;
  line-height: 1.6;
  margin: 0 auto 32px;
  color: var(--color-text);
  opacity: 0.85;
  max-width: 560px;
}

.es-placeholder-note {
  margin-top: 28px;
  font-size: 14px;
  color: var(--color-text);
  opacity: 0.75;
}
.es-placeholder-note a {
  color: var(--color-text);
  text-decoration: underline;
}

/* ─── Legal pages (privacy / terms / delete) ──────────── */
.legal-page {
  background: var(--color-surface);
  padding: 56px 0 96px;
}

.legal-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

.legal-content h1 {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 16px;
}
.legal-content h2 {
  font-size: 24px;
  font-weight: 700;
  margin-top: 40px;
  margin-bottom: 12px;
  color: var(--color-text);
  text-align: left;
}
.legal-content h3 {
  font-size: 19px;
  font-weight: 700;
  margin-top: 28px;
  margin-bottom: 8px;
}
.legal-content p {
  color: var(--color-text-secondary);
  margin-bottom: 16px;
  font-size: 16px;
  line-height: 1.7;
}
.legal-content ul {
  margin: 0 0 20px 24px;
  color: var(--color-text-secondary);
}
.legal-content li {
  margin-bottom: 8px;
  line-height: 1.7;
}
.legal-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 14px;
}
.legal-content th,
.legal-content td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-divider);
  text-align: left;
  vertical-align: top;
}
.legal-content th {
  background: var(--color-background);
  font-weight: 700;
  color: var(--color-text);
}

.legal-meta {
  font-size: 14px;
  color: var(--color-text-tertiary);
  margin-bottom: 32px;
  padding: 16px;
  background: var(--color-background);
  border-left: 3px solid var(--color-primary);
  border-radius: var(--radius-sm);
}
.legal-meta strong { color: var(--color-text); }

.draft-banner {
  background: #FFF8E1;
  border: 1px solid #FFD54F;
  color: #5D4037;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 32px;
  font-size: 14px;
}
.draft-banner strong { color: #4E342E; }

/* ─── Delete-account page ────────────────────────────── */
.step-list {
  margin: 0 0 24px 24px;
  color: var(--color-text-secondary);
  line-height: 1.8;
}
.form-card-lead { margin-bottom: 0; }
.form-card-list {
  margin: 12px 0 0 20px;
  color: var(--color-text-secondary);
}

/* ─── Forms (delete-account) ─────────────────────────── */
.form-card {
  background: var(--color-background);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin: 24px 0;
}
.form-card h3 { margin-top: 0; }

.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--color-text);
}
.form-group input[type="email"],
.form-group input[type="text"],
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: inherit;
  background: var(--color-surface);
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 191, 166, 0.15);
}
.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

/* ─── Mobile ─────────────────────────────────────────── */
@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }
  .hero-text { max-width: 100%; }
  .hero .cta-row { justify-content: center; }
  .phone-frame { transform: none; max-width: 240px; }
}

@media (max-width: 720px) {
  .hero { padding: 56px 0 48px; }
  .hero h1 { font-size: 32px; }
  .hero-sub { font-size: 16px; }
  section { padding: 56px 0; }
  section h2 { font-size: 28px; }
  .section-sub { font-size: 15px; margin-bottom: 40px; }
  .header-nav { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .plan-featured { transform: none; }
  .legal-content h1 { font-size: 28px; }
  .legal-content h2 { font-size: 20px; }
  .cta-row { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; max-width: 320px; margin-left: auto; margin-right: auto; }
}
