/* ==========================================================================
   2FA Tools & Guides Shared Stylesheet (Modern & Responsive)
   ========================================================================== */

:root {
  color-scheme: light dark;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  
  /* Light Theme Tokens */
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-heading: #0f172a;
  --border-light: #e2e8f0;
  --border-input: #cbd5e1;
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #e0f2fe;
  --accent-trust-bg: #ecfdf5;
  --accent-trust-border: #10b981;
  --accent-trust-text: #065f46;
  --accent-warn-bg: #fffbeb;
  --accent-warn-border: #f59e0b;
  --accent-warn-text: #92400e;
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-page: #0f172a;
    --bg-card: #1e293b;
    --bg-subtle: #1e293b;
    --text-main: #cbd5e1;
    --text-muted: #94a3b8;
    --text-heading: #f8fafc;
    --border-light: #334155;
    --border-input: #475569;
    --primary: #38bdf8;
    --primary-hover: #7dd3fc;
    --primary-light: rgba(56, 189, 248, 0.15);
    --accent-trust-bg: rgba(6, 78, 59, 0.25);
    --accent-trust-border: #059669;
    --accent-trust-text: #a7f3d0;
    --accent-warn-bg: rgba(120, 53, 15, 0.25);
    --accent-warn-border: #d97706;
    --accent-warn-text: #fde68a;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

nav.sitewide {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  border-bottom: 1px solid var(--border-light);
}

nav.sitewide a {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 9999px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

nav.sitewide a:hover {
  background-color: var(--primary-light);
  color: var(--primary);
}

nav.sitewide a:first-child {
  font-weight: 700;
  color: var(--primary);
  background-color: var(--primary-light);
}

nav.crumbs {
  max-width: 820px;
  margin: 16px auto 0;
  padding: 0 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

nav.crumbs a {
  color: var(--primary);
  text-decoration: none;
}

nav.crumbs a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */

main {
  max-width: 820px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

article header {
  text-align: center;
  margin-bottom: 32px;
}

h1, h2, h3, h4 {
  color: var(--text-heading);
  line-height: 1.25;
  font-weight: 700;
}

h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  letter-spacing: -0.03em;
  margin: 12px 0 16px;
}

.lead {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 660px;
  margin: 0 auto 20px;
}

section {
  margin-top: 44px;
}

h2 {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  margin-top: 0;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

h3 {
  font-size: 1.15rem;
  margin-top: 24px;
  margin-bottom: 10px;
}

p {
  margin: 0 0 16px;
}

a {
  color: var(--primary);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--primary-hover);
}

/* ==========================================================================
   Lists & Steps
   ========================================================================== */

ol, ul {
  padding-left: 24px;
  margin: 16px 0 20px;
}

li {
  margin-bottom: 10px;
}

li::marker {
  color: var(--primary);
  font-weight: 600;
}

/* ==========================================================================
   Callout Boxes & Badges
   ========================================================================== */

.trust {
  border-left: 4px solid var(--accent-trust-border);
  background-color: var(--accent-trust-bg);
  color: var(--accent-trust-text);
  border-radius: 12px;
  padding: 14px 18px;
  margin: 24px 0;
  font-size: 0.92rem;
  line-height: 1.55;
  text-align: left;
}

.notice {
  border-left: 4px solid var(--accent-warn-border);
  background-color: var(--accent-warn-bg);
  color: var(--accent-warn-text);
  border-radius: 12px;
  padding: 14px 18px;
  margin: 24px 0;
  font-size: 0.92rem;
  line-height: 1.55;
  text-align: left;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 14px 0 24px;
  border-radius: 12px;
  padding: 12px 24px;
  background-color: #0ea5e9;
  color: #ffffff;
  font-weight: 650;
  text-decoration: none;
  box-shadow: 0 4px 6px -1px rgba(14, 165, 233, 0.25);
  transition: all 0.15s ease;
}

.cta:hover {
  background-color: var(--primary-hover);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 12px -2px rgba(14, 165, 233, 0.35);
}

/* ==========================================================================
   Tables & Code
   ========================================================================== */

table.cmp {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 20px 0;
  font-size: 0.92rem;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background-color: var(--bg-card);
}

table.cmp th, table.cmp td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-light);
}

table.cmp tr:last-child td {
  border-bottom: 0;
}

table.cmp th {
  background-color: var(--bg-subtle);
  font-weight: 650;
  color: var(--text-heading);
}

code, pre {
  font-family: var(--font-mono);
}

pre {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
  box-shadow: var(--shadow-sm);
}

code:not(pre code) {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.85em;
  color: var(--text-heading);
}

/* ==========================================================================
   Footer & Related Links
   ========================================================================== */

footer.pagefoot {
  max-width: 820px;
  margin: 40px auto 0;
  padding: 32px 20px 64px;
  font-size: 0.88rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
  text-align: center;
}

ul.related {
  columns: 2;
  column-gap: 32px;
  padding-left: 20px;
  text-align: left;
}

/* ==========================================================================
   Advertisements (Responsive & Consent-Gated)
   ========================================================================== */

.ad-slot {
  max-width: 620px;
  margin: 32px auto;
  width: 100%;
  box-sizing: border-box;
}

.ad-card {
  border: 1px solid var(--border-light);
  border-radius: 16px;
  background-color: var(--bg-card);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
}

.ad-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.ad-native-container {
  min-height: 250px;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  overflow: hidden;
}

.ad-smartlink {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #ffffff !important;
  font-weight: 650;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 14px 20px;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
  transition: all 0.15s ease;
}

.ad-smartlink:hover {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.35);
}

/* ==========================================================================
   Mobile-First Responsive Adjustments
   ========================================================================== */

@media (max-width: 640px) {
  main {
    padding: 16px 14px 64px;
  }

  h1 {
    font-size: clamp(1.75rem, 6.5vw, 2.2rem);
    letter-spacing: -0.02em;
    margin: 8px 0 12px;
    word-break: break-word;
  }

  .lead {
    font-size: 1rem;
    line-height: 1.55;
    margin-bottom: 16px;
  }

  h2 {
    font-size: 1.3rem;
    margin-top: 32px;
  }

  nav.sitewide {
    gap: 6px 8px;
    padding: 12px 10px;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    border-bottom: 1px solid var(--border-light);
  }

  nav.sitewide a {
    font-size: 0.82rem;
    padding: 6px 12px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  nav.crumbs {
    padding: 0 14px;
    font-size: 0.8rem;
    margin-top: 12px;
  }

  ul.related {
    columns: 1;
    padding-left: 16px;
  }

  .trust, .notice {
    padding: 12px 14px;
    font-size: 0.88rem;
    border-radius: 10px;
  }

  .t2f-card {
    padding: 16px 14px !important;
    border-radius: 14px !important;
  }

  .t2f-code {
    font-size: clamp(1.9rem, 8.5vw, 2.4rem) !important;
    letter-spacing: 0.08em !important;
  }

  .t2f-row {
    flex-direction: column;
    gap: 8px;
  }

  .t2f-btn {
    width: 100%;
    min-height: 46px;
    justify-content: center;
  }

  .ad-slot {
    margin: 20px auto;
  }
}
