/* ── Microsoft-inspired design system ── */

:root {
  --bg: #ffffff;
  --bg-alt: #f2f2f2;
  --fg: #1a1a1a;
  --fg-secondary: #505050;
  --brand: #0067b8;
  --brand-hover: #005a9e;
  --card-bg: #ffffff;
  --border: #d2d2d2;
  --radius: 8px;
  --muted: #605e5c;
  --text: #323130;
  --danger: #d13438;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout shell ── */

.page { min-height: 100vh; display: flex; flex-direction: column; }
.page > main { flex: 1; }

/* ── Topbar / Navigation ── */

.topbar {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-header-dashboard .topbar {
  border-bottom: 1px solid #edebe9;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
  border-radius: 0;
}

.brand-name {
  font-size: 17px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.2px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 13px;
  font-weight: 400;
  color: var(--fg);
}

.nav a { color: var(--fg); }
.nav a:hover { color: var(--brand); text-decoration: underline; }

.nav-ms-signin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none !important;
  transition: background .15s, border-color .15s;
}
.nav-ms-signin:hover {
  background: var(--bg-alt);
  border-color: #bbb;
}
.nav-ms-signin svg { flex-shrink: 0; }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}
.topbar-user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-alt);
  color: var(--fg-secondary);
  flex-shrink: 0;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.topbar-user-avatar:hover,
.topbar-user.open .topbar-user-avatar {
  background: var(--brand);
  color: #fff;
}

/* User dropdown */
.topbar-user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 260px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e1dfdd);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 1000;
  padding: 16px;
}
.topbar-user.open .topbar-user-dropdown {
  display: block;
}
.topbar-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-dropdown-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-alt);
  color: var(--fg-secondary);
  flex-shrink: 0;
}
.topbar-dropdown-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar-dropdown-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-dropdown-email {
  font-size: 12px;
  color: var(--fg-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-dropdown-divider {
  height: 1px;
  background: var(--border, #e1dfdd);
  margin: 12px 0;
  border: none;
}
.topbar-dropdown-signout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: none;
  padding: 8px 8px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--fg-secondary);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background .15s, color .15s;
}
.topbar-dropdown-signout:hover {
  background: var(--bg-alt);
  color: var(--danger, #d13438);
}

/* Subscription badge in topbar */
.topbar-sub-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: filter .15s;
}
.topbar-sub-badge:hover {
  filter: brightness(0.92);
}
.topbar-sub-active {
  background: #dff6dd;
  color: #107c10;
}
.topbar-sub-inactive {
  background: #fff4ce;
  color: #797673;
}
.topbar-sub-inactive a {
  color: inherit;
  text-decoration: underline;
}

/* ── Dashboard sidebar navigation ── */

.topbar-row-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 28px;
}

.dash-sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  color: var(--fg-secondary);
  cursor: pointer;
  border-radius: 6px;
  padding: 0;
  margin-right: 8px;
  flex-shrink: 0;
}
.dash-sidebar-toggle:hover {
  background: var(--bg-alt);
  color: var(--fg);
}

.dash-layout {
  display: flex;
  min-height: calc(100vh - 49px);
}

.dash-sidebar {
  width: 220px;
  min-width: 220px;
  background: #fff;
  border-right: 1px solid #edebe9;
  padding: 16px 0;
  position: sticky;
  top: 49px;
  height: calc(100vh - 49px);
  overflow-y: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.dash-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px;
}

.dash-sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-secondary);
  text-decoration: none !important;
  border-radius: 6px;
  transition: color .15s, background .15s;
}

.dash-sidebar-item svg {
  flex-shrink: 0;
  opacity: .6;
  transition: opacity .15s;
}

.dash-sidebar-item:hover {
  color: var(--fg);
  background: var(--bg-alt);
}
.dash-sidebar-item:hover svg {
  opacity: 1;
}

.dash-sidebar-item.active {
  color: var(--brand);
  font-weight: 600;
  background: rgba(0,103,184,0.06);
}
.dash-sidebar-item.active svg {
  opacity: 1;
}

.dash-main {
  flex: 1;
  min-width: 0;
}

.dash-sidebar-overlay {
  display: none;
}

.lang-selector { position: relative; }
.lang-trigger {
  border: none;
  background: none;
  padding: 4px 8px;
  font-size: 13px;
  color: var(--fg);
  cursor: pointer;
  font-family: inherit;
}
.lang-dropdown {
  position: absolute; right: 0; top: 100%; margin-top: 4px;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 4px; min-width: 140px;
  box-shadow: 0 8px 24px rgba(0,0,0,.14); display: none; z-index: 200;
}
.lang-selector.open .lang-dropdown { display: block; }
.lang-option {
  display: flex; align-items: center; gap: 8px;
  border: none; background: transparent; padding: 8px 10px;
  border-radius: 4px; width: 100%; cursor: pointer; font-size: 13px;
  font-family: inherit;
}
.lang-option:hover, .lang-option.active { background: var(--bg-alt); }

/* ── Hero banner (Copilot-style) ── */

.hero-banner {
  position: relative;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(180, 160, 255, .45) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(120, 200, 255, .4) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(100, 210, 255, .5) 0%, transparent 40%),
    radial-gradient(ellipse at 30% 10%, rgba(255, 200, 200, .3) 0%, transparent 40%),
    linear-gradient(160deg, #f0e6ff 0%, #e0f0ff 30%, #d0f4ff 60%, #c8e8ff 100%);
  color: var(--fg);
  padding: 0 24px;
  min-height: 560px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-banner-inner {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 56px;
}

.hero-banner-text {
  padding: 72px 0;
}

.hero-banner-text h1 {
  font-size: clamp(30px, 4.5vw, 48px);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 16px;
  color: var(--fg);
}

.hero-banner-text p {
  font-size: 17px;
  line-height: 1.6;
  margin: 0 0 32px;
  color: var(--fg-secondary);
  max-width: 460px;
}

.hero-banner-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-illustration {
  width: 100%;
  max-width: 520px;
  height: auto;
}

/* ── Buttons ── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none !important;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.btn-primary:hover { background: var(--brand-hover); }

.btn-hero {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  font-weight: 600;
}
.btn-hero:hover { background: var(--brand-hover); }

.btn-outline {
  background: transparent;
  color: var(--brand);
  border-color: var(--brand);
}
.btn-outline:hover { background: rgba(0,103,184,.06); }

.btn-large { padding: 14px 32px; font-size: 16px; }

/* ── Sections ── */

.section { padding: 64px 24px; }

.section-content {
  max-width: 1600px;
  margin: 0 auto;
}

.section-title {
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 600;
  margin: 0 0 12px;
}

.lead {
  color: var(--fg-secondary);
  font-size: 16px;
  margin: 0;
  max-width: 700px;
}

/* ── Trust bar ── */

.trust-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 28px 24px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.trust-bar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fg-secondary);
  font-weight: 600;
}

.trust-bar-item svg { color: var(--brand); flex-shrink: 0; }

/* ── Content cards (Microsoft style) ── */

.ms-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 32px;
}

@media (max-width: 900px) {
  .ms-cards {
    grid-template-columns: 1fr;
  }
}

.ms-card {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s, transform .2s;
}
.ms-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  transform: translateY(-2px);
}

.ms-card-media {
  height: 200px;
  background: linear-gradient(135deg, #e8f0fe 0%, #f0f6ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ms-card-media svg {
  color: var(--brand);
  filter: drop-shadow(0 2px 4px rgba(0,103,184,.15));
}

.ms-card-media-schedule {
  background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
}
.ms-card-media-schedule svg { color: #0078d4; }

.ms-card-media-findings {
  background: linear-gradient(135deg, #fef3c7 0%, #fffbeb 100%);
}
.ms-card-media-findings svg { color: #c27803; }

.ms-card-media-reports {
  background: linear-gradient(135deg, #d1fae5 0%, #ecfdf5 100%);
}
.ms-card-media-reports svg { color: #047857; }

.ms-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.ms-card-body h3 { margin: 0; font-size: 18px; font-weight: 600; }
.ms-card-body p { margin: 0; color: var(--fg-secondary); font-size: 14px; }

.ms-card-body .btn-outline {
  align-self: flex-start;
  margin-top: auto;
  padding: 8px 16px;
  font-size: 14px;
}

/* ── Steps ── */

.steps-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  margin-top: 40px;
  counter-reset: step;
}

.step-item {
  counter-increment: step;
  text-align: center;
  flex: 1;
  max-width: 300px;
  padding: 0 24px;
  position: relative;
}

.step-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin-bottom: 20px;
  position: relative;
}

.step-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
}

.step-icon-signin { background: #deecf9; color: #0078d4; }
.step-icon-scan   { background: #dff6dd; color: #107c10; }
.step-icon-report { background: #e8dff7; color: #8764b8; }

.step-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  padding-top: 48px;
  color: var(--fg-secondary);
  opacity: 0.25;
}

.step-item h3 { font-size: 17px; font-weight: 600; margin: 0 0 8px; }
.step-item p { color: var(--fg-secondary); font-size: 14px; margin: 0; line-height: 1.6; }

@media (max-width: 860px) {
  .steps-row {
    flex-direction: column;
    align-items: center;
    gap: 0;
  }
  .step-item { max-width: 400px; width: 100%; }
  .step-connector {
    padding-top: 0;
    width: auto;
    height: 24px;
    transform: rotate(90deg);
  }
}

/* ── Pricing ── */

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 32px;
  max-width: 700px;
}

.pricing-card {
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 32px;
}

.pricing-card-featured {
  border-color: var(--brand);
  box-shadow: 0 4px 16px rgba(0,103,184,.12);
}

.pricing-card-title { font-size: 20px; font-weight: 600; margin: 0 0 8px; }
.pricing-card-copy { color: var(--fg-secondary); margin: 0 0 20px; font-size: 14px; }

.pricing-note { margin-top: 20px; color: var(--fg-secondary); font-size: 13px; }

/* ── FAQ ── */

.faq-list { max-width: 720px; margin-top: 24px; }

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 0;
  background: none;
  border-radius: 0;
}

.faq-item summary {
  padding: 16px 0;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  list-style: none;
}

.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::marker { content: ""; }

.faq-item summary::after {
  content: "+";
  float: right;
  font-size: 20px;
  font-weight: 400;
  color: var(--fg-secondary);
}

.faq-item[open] summary::after { content: "−"; }

.faq-item p {
  margin: 0 0 16px;
  color: var(--fg-secondary);
  font-size: 14px;
}

/* ── Demo email section ── */

.demo-email-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  margin-top: 32px;
}

.demo-email-text h2 { font-size: 28px; font-weight: 600; margin: 0 0 12px; }
.demo-email-text p { color: var(--fg-secondary); margin: 0; line-height: 1.6; }

.demo-email-form { display: flex; flex-direction: column; gap: 12px; }

.demo-email-input-group {
  display: flex;
  gap: 8px;
}

.demo-email-input {
  flex: 1;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--fg-primary);
  outline: none;
  transition: border-color 0.15s;
}
.demo-email-input:focus {
  border-color: #0078d4;
  box-shadow: 0 0 0 2px rgba(0,120,212,0.15);
}

.demo-email-btn {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.demo-email-msg {
  font-size: 13px;
  min-height: 20px;
}
.demo-email-msg.success { color: #107c10; }
.demo-email-msg.error { color: #d13438; }

/* ── Final CTA ── */

.section-cta {
  text-align: center;
  background: var(--bg-alt);
  padding: 80px 24px;
}

.final-cta-title {
  font-size: clamp(26px, 3.5vw, 40px);
  font-weight: 600;
  margin: 0 0 12px;
}

.final-cta-sub {
  color: var(--fg-secondary);
  margin: 0 0 28px;
  font-size: 16px;
}

/* ── Footer ── */

.footer {
  padding: 24px;
  color: var(--fg-secondary);
  font-size: 12px;
  text-align: center;
  border-top: 1px solid var(--border);
}

/* ── Dashboard pages (keep working) ── */

.page-wide {
  padding: 0 0 80px;
  background: #faf9f8;
}

/* ── Dashboard sub-page shared styles ── */

.dashboard-content {
  background: #faf9f8;
  min-height: 100vh;
}

.dashboard-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 32px 48px;
}

.card {
  background: var(--card-bg);
  border: 1px solid #edebe9;
  border-radius: 12px;
  overflow: hidden;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid #edebe9;
}

.card-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--fg);
}

.card-body {
  padding: 20px 24px;
}

/* ── Responsive ── */

@media (max-width: 860px) {
  .hero-banner { min-height: auto; }
  .hero-banner-inner { grid-template-columns: 1fr; }
  .hero-banner-visual { display: none; }
  .hero-banner-text { padding: 56px 0; }
  .hero-banner-text h1 { font-size: 30px; }

  .trust-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 20px 24px;
  }

  .trust-bar-item {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 12px;
  }

  .demo-email-card { grid-template-columns: 1fr; padding: 28px 24px; }
  .demo-email-input-group { flex-direction: column; }

  .pricing-grid { max-width: 100%; }
}

/* Sidebar collapses to mobile drawer at 860px */
@media (max-width: 860px) {
  .dash-sidebar-toggle {
    display: flex;
  }
  .dash-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 300;
    transform: translateX(-100%);
    transition: transform .2s ease;
    padding-top: 16px;
    box-shadow: none;
  }
  .dash-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,.12);
  }
  .dash-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.3);
    z-index: 299;
    display: none;
  }
  .dash-sidebar-overlay.open {
    display: block;
  }
}

@media (max-width: 600px) {
  .topbar-row-brand { padding: 10px 16px; }
  .section { padding: 48px 16px; }
  .hero-banner { padding: 0 16px; }
  .hero-banner-text h1 { font-size: 28px; }
  .nav { gap: 12px; }
  .trust-bar { padding: 16px; gap: 10px; }
  .topbar-sub-badge { display: none !important; }
  .brand-name { font-size: 15px; }
  .topbar-user-dropdown { min-width: 220px; right: -8px; }
}

@media (max-width: 380px) {
  .trust-bar { grid-template-columns: 1fr; }
}
