/* Shared styles for Privacy Policy, Terms, and Account Deletion pages */

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f1f5f9;
  min-height: 100vh;
  color: #334155;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: #2563eb;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  font-size: 0.9em;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  color: #475569;
}

/* Top bar */
.legal-topbar {
  background: #eef1f5;
  border-bottom: 1px solid #dde3ea;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.legal-topbar .back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #475569;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.legal-topbar .back-link:hover {
  color: #2563eb;
  text-decoration: none;
}

.legal-topbar .brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.legal-topbar .brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  border-radius: 8px;
  padding: 6px 14px;
  box-shadow: 0 2px 8px rgba(44, 62, 80, 0.18);
}

.legal-topbar .brand img {
  height: 34px;
  width: auto;
  object-fit: contain;
  display: block;
}

.legal-topbar .brand-divider {
  width: 1px;
  height: 28px;
  background: #cbd5e1;
  flex-shrink: 0;
}

.legal-topbar .brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.15;
}

.legal-topbar .brand-name {
  font-size: 16px;
  font-weight: 700;
  color: #2c3e50;
  letter-spacing: -0.02em;
}

.legal-topbar .brand-tagline {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legal-topbar .brand-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  padding: 2px 7px;
  border-radius: 3px;
}

.legal-topbar .brand-sub {
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
  letter-spacing: 0.01em;
}

/* Main layout */
.legal-main {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.legal-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}

.legal-header {
  padding: 32px 36px 24px;
  border-bottom: 1px solid #f1f5f9;
}

.legal-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.legal-header .subtitle {
  font-size: 15px;
  color: #64748b;
  margin-bottom: 12px;
}

.legal-header .meta {
  font-size: 13px;
  color: #94a3b8;
}

.legal-body {
  padding: 28px 36px 32px;
}

/* Table of contents */
.legal-toc {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 18px 22px;
  margin-bottom: 28px;
}

.legal-toc-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 12px;
}

.legal-toc ol {
  padding-left: 18px;
  columns: 2;
  column-gap: 24px;
}

.legal-toc li {
  font-size: 14px;
  margin-bottom: 5px;
  break-inside: avoid;
}

.legal-toc a {
  color: #475569;
}

.legal-toc a:hover {
  color: #2563eb;
}

/* Sections */
.legal-section {
  margin-bottom: 28px;
  scroll-margin-top: 72px;
}

.legal-section:last-of-type {
  margin-bottom: 0;
}

.legal-section h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.legal-section h3 {
  font-size: 15px;
  font-weight: 600;
  color: #334155;
  margin: 16px 0 8px;
}

.legal-section p,
.legal-section li {
  font-size: 15px;
  color: #475569;
  margin-bottom: 10px;
}

.legal-section ul,
.legal-section ol {
  padding-left: 20px;
  margin-bottom: 12px;
}

.legal-section li {
  margin-bottom: 5px;
}

.legal-note {
  background: #eff6ff;
  border-left: 3px solid #2563eb;
  border-radius: 0 6px 6px 0;
  padding: 14px 16px;
  margin: 14px 0;
}

.legal-note p {
  margin-bottom: 0;
  color: #334155;
  font-size: 14px;
}

/* Tables */
.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 16px;
  font-size: 14px;
}

.legal-table th,
.legal-table td {
  border: 1px solid #e2e8f0;
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.legal-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #334155;
  font-size: 13px;
}

.legal-table td {
  color: #475569;
}

/* Footer nav */
.legal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  padding: 20px 36px;
  border-top: 1px solid #f1f5f9;
  background: #fafbfc;
}

.legal-footer a {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

.legal-footer a:hover {
  color: #2563eb;
}

/* Form (Account Deletion) */
.legal-intro {
  font-size: 15px;
  color: #475569;
  margin-bottom: 16px;
}

.legal-list {
  padding-left: 20px;
  margin-bottom: 24px;
}

.legal-list li {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 6px;
}

.legal-form .form-group {
  margin-bottom: 16px;
}

.legal-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.legal-form .optional {
  font-weight: 400;
  color: #94a3b8;
}

.legal-form .required {
  color: #dc2626;
}

.legal-form input,
.legal-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  color: #1e293b;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.legal-form input:focus,
.legal-form textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.legal-form textarea {
  min-height: 96px;
  resize: vertical;
}

.legal-form .btn-submit {
  width: 100%;
  padding: 12px;
  margin-top: 4px;
  border: none;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.legal-form .btn-submit:hover:not(:disabled) {
  background: #1d4ed8;
}

.legal-form .btn-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.legal-form .form-msg {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  display: none;
}

.legal-form .form-msg.success {
  display: block;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.legal-form .form-msg.error {
  display: block;
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Responsive */
@media (max-width: 640px) {
  .legal-topbar {
    padding: 12px 16px;
  }

  .legal-topbar .brand-sub,
  .legal-topbar .brand-divider {
    display: none;
  }

  .legal-topbar .brand-text {
    flex-direction: row;
    align-items: center;
    gap: 6px;
  }

  .legal-topbar .brand-name {
    font-size: 15px;
  }

  .legal-main {
    padding: 20px 16px 32px;
  }

  .legal-header,
  .legal-body {
    padding-left: 20px;
    padding-right: 20px;
  }

  .legal-header {
    padding-top: 24px;
  }

  .legal-header h1 {
    font-size: 1.4rem;
  }

  .legal-toc ol {
    columns: 1;
  }

  .legal-footer {
    padding: 16px 20px;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .legal-table {
    font-size: 13px;
  }

  .legal-table th,
  .legal-table td {
    padding: 8px;
  }
}
