/* Tora Digital — App User Guide Portal
   Styled to match Red Flag Alert (redflagalert.com): Plus Jakarta Sans,
   warm cream background, navy text, red accents, white rounded cards. */
:root {
  /* Red Flag Alert brand tokens */
  --bg: #fafaf4;          /* graphite-50, warm cream page background */
  --surface: #ffffff;     /* white cards */
  --surface-alt: #f8f7ee; /* graphite-100, soft section background */
  --border: #e4e4dc;      /* subtle warm border */
  --border-strong: #ddded8;
  --text: #232c3e;        /* graphite-900 / brand-black */
  --muted: #585f6a;       /* graphite-700 */
  --muted-2: #8e9296;     /* graphite-500 */
  --brand: #d13255;       /* red-600 / brand-red */
  --brand-dark: #af2e48;  /* red-700 */
  --brand-soft: #fff4f4;  /* red-50 */
  --purple: #5a3d85;      /* purple-800 / brand-purple */
  --purple-dark: #432e5f; /* purple-900, button hover */
  --purple-50: #f7f6fa;   /* button text */
  --green: #027a48;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 8px 24px rgba(16, 24, 40, 0.06);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08);
  --maxw: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-weight: 400;
  min-height: 100vh;
  overflow-x: clip; /* guard against horizontal overflow (doesn't break sticky) */
  -webkit-font-smoothing: antialiased;
}

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

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(250, 250, 244, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand .logo-img { height: 30px; width: auto; display: block; }
.brand .divider { width: 1px; height: 28px; background: var(--border-strong); }
.brand .sub { display: flex; flex-direction: column; line-height: 1.15; }
.brand .sub strong { font-weight: 700; font-size: 0.82rem; color: var(--text); }
.brand small { font-weight: 500; font-size: 0.72rem; color: var(--muted-2); }

.nav { display: flex; align-items: center; }
.nav a { color: var(--muted); margin-left: 26px; font-size: 0.95rem; font-weight: 600; }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a.nav-ext {
  color: var(--purple-50);
  background: var(--purple);
  border: 3px solid var(--purple);
  padding: 7px 22px;
  border-radius: 4px;
  font-weight: 300;
  transition: all 0.3s;
}
.nav a.nav-ext:hover { background: var(--purple-dark); border-color: var(--purple-dark); color: var(--purple-50); }
.brand .sub strong { white-space: nowrap; }

/* Mobile menu toggle (hamburger) — created by main.js, hidden on desktop */
.nav-toggle { display: none; }

/* Hero */
.hero { padding: 76px 0 36px; text-align: center; }
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 800;
  margin: 0 0 16px;
}
.hero p { color: var(--muted); max-width: 660px; margin: 0 auto; font-size: 1.1rem; }
.hero .tagline {
  display: inline-block;
  color: var(--brand);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 auto 18px;
  padding: 6px 14px;
  background: var(--brand-soft);
  border-radius: 999px;
}

/* Breadcrumb */
.breadcrumb { color: var(--muted); font-size: 0.9rem; padding: 24px 0 0; font-weight: 500; }
.breadcrumb a { color: var(--muted); }

/* Section */
.section { padding: 32px 0 72px; }
.section-title { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.01em; margin: 8px 0 24px; }

/* Service cards (side by side) */
.service-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.service-item {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.service-item:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--border-strong); text-decoration: none; }
.service-item .service-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: grid; place-items: center;
  margin-bottom: 16px;
  background: rgba(90, 61, 133, 0.1);
}
.service-item h3 { margin: 0 0 8px; font-size: 1.2rem; font-weight: 700; color: var(--text); }
.service-item p { margin: 0; color: var(--muted); font-size: 0.95rem; flex: 1; }
.service-item .service-cta { margin-top: 16px; color: var(--brand); font-weight: 700; font-size: 0.92rem; }

/* Latest news & features */
.news-list { display: flex; flex-direction: column; gap: 14px; }
.news-item {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--purple);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
}
.news-item .news-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 110px;
}
.news-item .news-date { color: var(--muted-2); font-size: 0.82rem; font-weight: 500; }
.news-item .news-body { min-width: 0; }
.news-item h3 { margin: 0 0 4px; font-size: 1.1rem; font-weight: 700; color: var(--text); }
.news-item p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.news-item .news-link { display: inline-block; margin-top: 10px; font-weight: 600; font-size: 0.9rem; }
.badge.update { color: var(--purple); background: #efecf4; align-self: flex-start; }

@media (max-width: 600px) {
  .news-item { flex-direction: column; gap: 12px; }
  .news-item .news-meta { flex-direction: row; align-items: center; flex-basis: auto; }
}

/* Grid of cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 22px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
  text-decoration: none;
}
.card .card-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: grid; place-items: center;
  margin-bottom: 16px;
}
.card .card-logo {
  width: 32px; height: 32px;
  object-fit: contain;
  display: block;
}
.card h3 { margin: 0 0 8px; font-size: 1.2rem; font-weight: 700; color: var(--text); }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; flex: 1; }
.card .card-meta { margin-top: 18px; display: flex; align-items: center; gap: 10px; }
.card .card-actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.card .card-actions .btn { flex: 1 1 auto; padding: 9px 16px; font-size: 0.9rem; white-space: nowrap; }

/* Badges */
.badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.badge.live { color: var(--green); background: #ecfdf3; }
.badge.soon { color: var(--purple); background: #efecf4; }
.badge.count { color: var(--brand); background: var(--brand-soft); }

.card.disabled { opacity: 0.62; pointer-events: none; box-shadow: none; }

/* App detail rows */
.app {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.app-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.app h3 { margin: 0; font-size: 1.3rem; font-weight: 700; }
.app .version { color: var(--muted-2); font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
.app p { color: var(--muted); margin: 12px 0 16px; }
.app ul { color: var(--muted); margin: 0 0 18px; padding-left: 20px; }
.app ul li { margin: 5px 0; }

/* Buttons */
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }
/* Buttons match Red Flag Alert's "Speak to an Expert" style */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 40px;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 300;
  text-align: center;
  /* outline variant (secondary) */
  border: 2px solid var(--purple);
  color: var(--purple);
  background: var(--bg);
  transition: all 0.3s;
}
.btn:hover { text-decoration: none; background: var(--purple); color: var(--purple-50); }
.btn.primary {
  border: 3px solid var(--purple);
  background: var(--purple);
  color: var(--purple-50);
}
.btn.primary:hover { background: var(--purple-dark); border-color: var(--purple-dark); color: var(--purple-50); }

/* Guide content (converted from Word) */
.guide-layout { display: grid; grid-template-columns: 250px 1fr; gap: 44px; align-items: start; }
.toc {
  position: sticky; top: 90px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
}
.toc h4 { margin: 0 0 12px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-2); font-weight: 700; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 2px 0; }
.toc a { color: var(--muted); display: block; padding: 5px 10px; border-radius: 7px; line-height: 1.35; font-weight: 500; }
.toc a:hover { color: var(--brand); background: var(--brand-soft); text-decoration: none; }
.toc li.toc-top { margin-top: 10px; }
.toc li.toc-top > a { color: var(--text); font-weight: 700; }

.guide-content { min-width: 0; max-width: 760px; }
.guide-content h2 {
  font-size: 1.7rem; font-weight: 800; letter-spacing: -0.01em;
  margin: 48px 0 16px; padding-bottom: 10px;
  border-bottom: 2px solid var(--brand);
  scroll-margin-top: 90px;
}
.guide-content h3 {
  font-size: 1.3rem; font-weight: 700; margin: 36px 0 12px; color: var(--text);
  scroll-margin-top: 90px;
}
.guide-content h4 { font-size: 1.02rem; font-weight: 700; margin: 24px 0 8px; color: var(--purple); }
.guide-content p { color: var(--text); margin: 0 0 14px; }
.guide-content ul { color: var(--text); margin: 0 0 16px; padding-left: 22px; }
.guide-content ul li { margin: 6px 0; }
.guide-content a { color: var(--brand); font-weight: 600; }
.guide-content figure.shot {
  margin: 20px 0 26px; padding: 14px;
  height: 420px;                /* uniform frame — every screenshot same size */
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  overflow: hidden; background: #fff; box-shadow: var(--shadow-sm);
}
.guide-content figure.shot img {
  display: block;
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;          /* scale to fit without distortion */
}
.guide-content strong { color: var(--text); font-weight: 700; }

@media (max-width: 860px) {
  .guide-layout { grid-template-columns: 1fr; }
  .toc { position: static; }
}

/* Section header with action button */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.section-head .section-title { margin: 0; }

/* Modal / popup */
.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-backdrop { position: absolute; inset: 0; background: rgba(35, 44, 62, 0.55); backdrop-filter: blur(2px); }
.modal-dialog {
  position: relative;
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(16, 24, 40, 0.28);
  width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  padding: 32px;
  animation: modal-in 0.18s ease-out;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.modal-title { margin: 0 0 6px; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.01em; }
.modal-close {
  position: absolute; top: 14px; right: 16px;
  width: 36px; height: 36px;
  border: none; background: transparent;
  font-size: 1.7rem; line-height: 1; color: var(--muted);
  cursor: pointer; border-radius: 8px;
}
.modal-close:hover { background: var(--surface-alt); color: var(--text); }
body.modal-open { overflow: hidden; }

/* Request a feature form */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.section-intro { color: var(--muted); max-width: 640px; margin: -10px 0 24px; }
.feature-form { max-width: 680px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-field { display: flex; flex-direction: column; margin-bottom: 18px; }
.form-field label { font-size: 0.88rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-field label .optional { color: var(--muted-2); font-weight: 500; }
.feature-form input,
.feature-form textarea {
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 11px 14px;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.feature-form input:focus,
.feature-form textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(90, 61, 133, 0.15);
}
.feature-form textarea { resize: vertical; min-height: 120px; }
.crm-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.crm-option {
  display: flex; align-items: center; gap: 9px;
  font-size: 0.95rem; font-weight: 500; color: var(--text);
  padding: 8px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.crm-option:hover { border-color: var(--purple); }
.crm-option input { width: auto; accent-color: var(--purple); cursor: pointer; }
.crm-other { margin-top: 10px; }
@media (max-width: 460px) { .crm-options { grid-template-columns: 1fr; } }
.form-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 4px; }
.form-status { margin: 0; font-size: 0.92rem; font-weight: 600; }
.form-status.success { color: var(--green); }
.form-status.error { color: var(--brand); }

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
  padding: 32px 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  text-align: center;
}

/* Mobile header: collapse nav behind a hamburger */
@media (max-width: 768px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: var(--surface);
    cursor: pointer;
  }
  .nav-toggle span,
  .nav-toggle span::before,
  .nav-toggle span::after {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
  }
  .nav-toggle span { position: relative; }
  .nav-toggle span::before { content: ""; position: absolute; top: -6px; }
  .nav-toggle span::after { content: ""; position: absolute; top: 6px; }

  .site-header .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 24px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .site-header .nav.open { display: flex; }
  .nav a { margin-left: 0; padding: 12px 6px; font-size: 1rem; }
  .nav a.nav-ext { align-self: flex-start; margin-top: 8px; padding: 9px 18px; }
}

@media (max-width: 600px) {
  .hero { padding: 48px 0 24px; }
}
