/* =============================================================================
   TutSync — shared styles for static legal pages (privacy.html, terms.html).
   Matches the landing site's brand (Inter, sky→indigo→violet gradient, tokens).
   These pages live in public/ and are served as-is by Firebase Hosting.
   ============================================================================= */

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

:root {
  --primary-color: #0ea5e9;
  --primary-dark: #0284c7;
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --surface-alt: #f7f9fc;
  --text-primary: #0f172a;
  --text-secondary: #52607a;
  --text-muted: #94a3b8;
  --border-color: #e6eaf2;
  --border-light: #eef1f7;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --brand-gradient: linear-gradient(120deg, #0ea5e9 0%, #6366f1 58%, #8b5cf6 100%);
  --shadow-sm: 0 1px 2px 0 rgb(15 23 42 / 0.06);
  --shadow-glow: 0 12px 30px -8px rgb(14 165 233 / 0.45);
  --container: 820px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto',
    'Helvetica Neue', sans-serif;
  background: #fff;
  color: var(--text-primary);
  line-height: 1.7;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ---- Top bar -------------------------------------------------------------- */
.legal-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border-light);
}
.legal-nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  height: 64px;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}
.brand:hover {
  text-decoration: none;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.back-home {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

/* ---- Header band ---------------------------------------------------------- */
.legal-header {
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border-light);
}
.legal-header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 2.75rem 1.25rem 2.25rem;
}
.legal-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-pill);
  margin-bottom: 1rem;
}
.legal-header h1 {
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.legal-meta {
  margin-top: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ---- Content -------------------------------------------------------------- */
.legal-content {
  max-width: var(--container);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3.5rem;
}
.legal-content h2 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 2.25rem 0 0.75rem;
  padding-top: 0.5rem;
}
.legal-content h2:first-child {
  margin-top: 0;
}
.legal-content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1.4rem 0 0.5rem;
}
.legal-content p,
.legal-content li {
  color: #26324a;
  font-size: 1rem;
}
.legal-content p {
  margin-bottom: 1rem;
}
.legal-content ul {
  margin: 0 0 1rem 1.25rem;
}
.legal-content li {
  margin-bottom: 0.5rem;
}
.legal-content strong {
  color: var(--text-primary);
}
.legal-intro {
  font-size: 1.08rem;
  color: var(--text-secondary);
}

/* Placeholder highlight — replace every [BRACKETED] value before going live. */
.ph {
  background: #fef9c3;
  color: #854d0e;
  padding: 0.05em 0.35em;
  border-radius: 5px;
  font-weight: 600;
  font-style: normal;
  white-space: nowrap;
}

/* Callout for the "template, get legal review" notice */
.legal-note {
  display: flex;
  gap: 0.75rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  font-size: 0.92rem;
  margin-bottom: 2rem;
}

/* Table */
.legal-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 1.5rem;
  font-size: 0.92rem;
}
.legal-content th,
.legal-content td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border-color);
  vertical-align: top;
}
.legal-content th {
  background: var(--surface-alt);
  font-weight: 700;
}
.table-scroll {
  overflow-x: auto;
}

/* ---- Deletion request form ------------------------------------------------ */
.contact-form {
  margin-top: 0.5rem;
  max-width: 560px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.field {
  margin-bottom: 1.05rem;
}
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}
.field input,
.field textarea {
  width: 100%;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font: inherit;
  color: var(--text-primary);
  background: var(--surface-alt);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14);
}
.field textarea {
  resize: vertical;
  min-height: 110px;
}
.field .err {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: #ef4444;
}
.btn-submit {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.5rem;
  min-height: 48px;
  border: none;
  border-radius: var(--radius-pill);
  font: inherit;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  background-image: var(--brand-gradient);
  background-size: 140% 140%;
  background-position: 0% 50%;
  box-shadow: var(--shadow-glow);
  transition: transform 0.18s ease, background-position 0.18s ease, box-shadow 0.18s ease;
}
.btn-submit:hover {
  background-position: 100% 50%;
  transform: translateY(-2px);
}
.form-hint {
  margin-top: 0.9rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}
.form-error {
  margin-top: 0.85rem;
  font-size: 0.85rem;
  color: #ef4444;
  text-align: center;
}
.btn-submit[disabled] {
  opacity: 0.75;
  cursor: default;
}
.spin {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: -2px;
  margin-right: 0.4rem;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.form-success {
  max-width: 560px;
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.3rem;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
}
.form-success svg {
  color: #10b981;
}
.form-success h4 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 0.35rem;
}
.form-success p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ---- Footer --------------------------------------------------------------- */
.legal-footer {
  background: #0b1220;
  color: #94a3b8;
}
.legal-footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 1.75rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
}
.legal-footer a {
  color: #cbd5e1;
  font-weight: 600;
}
.legal-footer a:hover {
  color: #fff;
}
.legal-footer nav {
  display: flex;
  gap: 1.25rem;
}
