:root {
  --app-bg: #f0f4f8;
  --app-bg-accent: #e2e8f0;
  --header-gradient-start: #0f172a;
  --header-gradient-mid: #1e3a8a;
  --header-gradient-end: #312e81;
  --header-text: #f8fafc;
  --header-muted: rgba(248, 250, 252, 0.72);
  --nav-pill-active: #fff;
  --nav-pill-hover: rgba(255, 255, 255, 0.12);
  --footer-bg: #0f172a;
  --footer-border: rgba(148, 163, 184, 0.2);
  --brand-accent: #38bdf8;
  --shadow-soft: 0 12px 40px rgba(15, 23, 42, 0.12);
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
}

html {
  font-size: 15px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body.app-body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--app-bg);
  background-image:
    radial-gradient(ellipse 900px 420px at 15% -5%, rgba(56, 189, 248, 0.12), transparent 55%),
    radial-gradient(ellipse 700px 380px at 95% 10%, rgba(99, 102, 241, 0.1), transparent 50%),
    linear-gradient(180deg, var(--app-bg) 0%, var(--app-bg-accent) 100%);
  color: #1e293b;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(37, 99, 235, 0.35);
}

/* ——— Header / navbar ——— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.25);
}

.site-navbar {
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
  background: linear-gradient(115deg, var(--header-gradient-start) 0%, var(--header-gradient-mid) 45%, var(--header-gradient-end) 100%);
  border: none;
}

.site-navbar .navbar-toggler {
  border-color: rgba(255, 255, 255, 0.25);
}

.site-navbar .navbar-toggler-icon {
  filter: invert(1);
}

.site-brand {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--header-text) !important;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-brand:hover {
  color: #fff !important;
}

.site-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, var(--brand-accent), #6366f1);
  color: #0f172a;
  font-size: 0.85rem;
  font-weight: 800;
}

.site-navbar .nav-link {
  color: var(--header-muted) !important;
  font-weight: 500;
  padding: 0.5rem 0.85rem !important;
  border-radius: 0.5rem;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.site-navbar .nav-link:hover {
  color: #fff !important;
  background: var(--nav-pill-hover);
}

.site-navbar .nav-link.active {
  color: #0f172a !important;
  background: #fff;
}

.site-navbar .btn-signout {
  color: var(--header-muted) !important;
  font-weight: 500;
  text-decoration: none;
  padding: 0.5rem 0.85rem !important;
  border-radius: 0.5rem;
}

.site-navbar .btn-signout:hover {
  color: #fff !important;
  background: rgba(248, 113, 113, 0.2);
}

.site-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--header-text);
  font-size: 0.875rem;
  font-weight: 500;
}

.site-user-pill .dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.35);
}

/* ——— Main ——— */
.site-main {
  flex: 1 0 auto;
  padding-bottom: 2rem;
}

.site-main .container,
.site-main .container-fluid {
  max-width: 95%;
}

/* ——— Footer ——— */
.site-footer {
  flex-shrink: 0;
  margin-top: auto;
  background: var(--footer-bg);
  color: var(--header-muted);
  border-top: 1px solid var(--footer-border);
  padding: 2rem 0 1.75rem;
}

.site-footer a {
  color: #93c5fd;
  text-decoration: none;
}

.site-footer a:hover {
  color: #bfdbfe;
  text-decoration: underline;
}

.site-footer-brand {
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.02em;
}

.site-footer-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .site-footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
    align-items: start;
  }
}

.site-footer-copy {
  font-size: 0.875rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--footer-border);
  color: rgba(148, 163, 184, 0.95);
}

.site-footer-tagline {
  max-width: 22rem;
  line-height: 1.55;
}

.footer-heading {
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #94a3b8;
}

.btn-footer-signout {
  color: #93c5fd !important;
  text-decoration: none;
}

.btn-footer-signout:hover {
  color: #bfdbfe !important;
  text-decoration: underline;
}

.nav-cta-signin {
  color: #fff !important;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.5rem 1rem !important;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.nav-cta-signin:hover {
  background: rgba(255, 255, 255, 0.28);
  color: #fff !important;
}

/* ——— Home page ——— */
.home-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: clamp(2rem, 5vw, 3.25rem);
  margin-bottom: 2rem;
  background: linear-gradient(125deg, #0f172a 0%, #1e40af 38%, #4338ca 100%);
  color: #f8fafc;
  box-shadow: var(--shadow-soft);
}

.home-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 280px at 100% 0%, rgba(56, 189, 248, 0.25), transparent 55%);
  pointer-events: none;
}

.home-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 38rem;
}

.home-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.home-hero-lead {
  font-size: 1.05rem;
  line-height: 1.55;
  color: rgba(226, 232, 240, 0.92);
  margin-bottom: 1.5rem;
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.home-hero .btn-light {
  font-weight: 600;
  padding: 0.55rem 1.25rem;
  border: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.home-hero .btn-outline-light {
  font-weight: 600;
  padding: 0.55rem 1.25rem;
  border-width: 2px;
}

.home-hero .btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.home-cards {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .home-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.home-card {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #fff;
  padding: 1.35rem 1.25rem;
  height: 100%;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.home-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.1);
}

.home-card-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
}

.home-card-letter {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
}

.home-card-icon.workspace {
  background: linear-gradient(135deg, #dbeafe, #e0e7ff);
}

.home-card-icon.privacy {
  background: linear-gradient(135deg, #ccfbf1, #cffafe);
}

.home-card-icon.docs {
  background: linear-gradient(135deg, #fef3c7, #ffedd5);
}

.home-card-icon.workspace .home-card-letter {
  color: #1d4ed8;
}

.home-card-icon.privacy .home-card-letter {
  color: #0f766e;
}

.home-card-icon.docs .home-card-letter {
  color: #b45309;
}

.home-card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #0f172a;
}

.home-card p {
  font-size: 0.9rem;
  color: #64748b;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.home-card .stretched-link {
  font-weight: 600;
  font-size: 0.9rem;
}

.home-strip {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.3);
  font-size: 0.9rem;
  color: #475569;
}

/* ——— Generic content pages (Privacy, etc.) ——— */
.content-panel {
  border-radius: var(--radius-xl);
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: clamp(1.5rem, 4vw, 2.25rem);
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  max-width: 48rem;
}

.content-panel h1 {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.content-panel p {
  color: #475569;
  line-height: 1.65;
  margin-bottom: 0.75rem;
}

.content-panel p:last-child {
  margin-bottom: 0;
}
