/* ===== MagenSafe Shared Styles ===== */
:root {
  color-scheme: light dark;
  --bg-body: #0B1220;
  --bg-card: #0F172A;
  --bg-input: #111827;
  --bg-info: #1E293B;
  --border: #334155;
  --border-hover: #475569;
  --text-primary: #E5E7EB;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  --accent: #60A5FA;
  --accent-hover: #93C5FD;
  --btn-primary: #2563EB;
  --btn-primary-hover: #1D4ED8;
  --btn-secondary: #334155;
  --btn-secondary-hover: #475569;
  --success-bg: #064E3B;
  --success-border: #065F46;
  --success-text: #D1FAE5;
  --error-bg: #7F1D1D;
  --error-border: #991B1B;
  --error-text: #FEE2E2;
  --required: #F87171;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* ===== Header ===== */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.logo-group:hover { text-decoration: none; }
.logo-img { height: 36px; width: auto; }
.logo-text {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Desktop nav */
.site-nav {
  display: flex;
  gap: 24px;
  align-items: center;
}
.site-nav a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 15px;
  transition: color 0.2s;
  text-decoration: none;
}
.site-nav a:hover,
.site-nav a.active {
  color: var(--text-primary);
  text-decoration: none;
}

/* Mobile hamburger */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle svg { display: block; }
.nav-toggle .bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-muted);
  margin: 5px 0;
  border-radius: 2px;
  transition: all 0.3s;
}

@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px 24px;
    gap: 16px;
  }
  .site-nav.open { display: flex; }
}

/* ===== Footer ===== */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  margin-top: 60px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
}
.footer-col h4 {
  color: var(--text-primary);
  font-size: 15px;
  margin-bottom: 14px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: var(--text-muted); font-size: 14px; }
.footer-col a:hover { color: var(--text-secondary); text-decoration: none; }
.footer-bottom {
  text-align: center;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 13px;
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 80px 24px;
  background: linear-gradient(135deg, var(--bg-card) 0%, #1E293B 100%);
}
.hero h1 {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #60A5FA 0%, #34D399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: 20px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 32px;
}
.cta-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .hero { padding: 48px 20px; }
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 17px; }
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 16px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--btn-primary); color: #fff; }
.btn-primary:hover:not(:disabled) {
  background: var(--btn-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  color: #fff;
}
.btn-secondary { background: var(--btn-secondary); color: var(--text-primary); }
.btn-secondary:hover:not(:disabled) {
  background: var(--btn-secondary-hover);
  transform: translateY(-1px);
  color: var(--text-primary);
}
.btn:disabled { background: var(--btn-secondary); cursor: not-allowed; opacity: 0.6; }
.btn-full { width: 100%; }

/* ===== Container / Layout ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 60px 24px; }
.container-sm { max-width: 620px; margin: 0 auto; padding: 40px 24px; }

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.35);
}
.card-header { text-align: center; margin-bottom: 32px; }
.card-header .logo-img { height: 56px; margin-bottom: 14px; }
.card-header h1 { font-size: 26px; margin-bottom: 6px; }
.card-header .subtitle { color: var(--text-muted); font-size: 15px; }

/* ===== Info Boxes ===== */
.info-box {
  background: var(--bg-info);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 24px;
}
.info-box h3 { font-size: 15px; color: var(--accent); margin-bottom: 8px; }
.info-box p { font-size: 14px; color: var(--text-secondary); line-height: 1.5; }
.info-box ul { margin-top: 8px; padding-left: 20px; font-size: 14px; color: var(--text-secondary); }
.info-box li { margin-bottom: 4px; }

/* ===== Forms ===== */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #E2E8F0;
  font-size: 14px;
}
.form-group .req { color: var(--required); }
input, textarea, select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 16px;
  font-family: inherit;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
}
textarea { min-height: 100px; resize: vertical; }
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(0.8);
}

/* ===== Messages ===== */
.msg { padding: 12px 16px; border-radius: var(--radius-sm); margin-top: 16px; font-size: 14px; }
.msg-success { background: var(--success-bg); border: 1px solid var(--success-border); color: var(--success-text); }
.msg-error { background: var(--error-bg); border: 1px solid var(--error-border); color: var(--error-text); }
.msg h3 { margin: 0 0 6px; font-size: 15px; }
.msg p { margin: 0; }

/* ===== Section Titles ===== */
.section-title { font-size: 32px; font-weight: 700; text-align: center; margin-bottom: 12px; }
.section-subtitle {
  font-size: 18px;
  color: var(--text-muted);
  text-align: center;
  max-width: 700px;
  margin: 0 auto 48px;
}

/* ===== Features Grid ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 48px;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all 0.2s;
}
.feature-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.feature-icon { font-size: 48px; margin-bottom: 14px; }
.feature-card h3 { font-size: 20px; margin-bottom: 10px; color: var(--text-primary); }
.feature-card p { color: var(--text-muted); }

/* ===== How It Works ===== */
.steps { counter-reset: step; }
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  margin-top: 48px;
}
.step {
  text-align: center;
  counter-increment: step;
}
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--btn-primary);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
}
.step h3 { font-size: 18px; margin-bottom: 8px; color: var(--text-primary); }
.step p { font-size: 14px; color: var(--text-muted); line-height: 1.5; }

/* ===== App Store Links ===== */
.store-badges {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 24px;
}
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  background: var(--btn-secondary);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 15px;
  transition: all 0.2s;
}
.store-badge:hover {
  background: var(--btn-secondary-hover);
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--text-primary);
}
.store-badge svg { width: 24px; height: 24px; flex-shrink: 0; }

/* ===== Legal Pages ===== */
.legal h1 { font-size: 26px; margin-bottom: 8px; }
.legal h2 { font-size: 19px; margin: 28px 0 10px; color: var(--text-primary); }
.legal p, .legal li { line-height: 1.7; color: var(--text-secondary); }
.legal ul { padding-left: 20px; }
.legal .muted { color: var(--text-muted); font-size: 13px; }

/* ===== Back Link ===== */
.back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--text-muted);
  font-size: 14px;
}
.back-link:hover { color: var(--text-secondary); text-decoration: none; }
