/* Shared styles for the standalone content pages: privacy, terms, report.
 *
 * These rules lived as a duplicated inline <style> block inside privacy.html
 * (100 lines) and terms.html (70 lines). report.html shipped with NEITHER, so
 * every class its markup referenced -- .legal-content, .back-link, .form-row --
 * was undefined and the page rendered as raw unstyled HTML from the day it
 * landed. Extracting the block here fixes report.html and removes the
 * duplication in one move.
 *
 * Everything below uses the tokens defined in style.css (:root), so this file
 * must be linked AFTER it.
 */

/* ── Page shell ─────────────────────────────────────────────────────────── */

.legal-content {
  padding: 120px 0 80px;
  min-height: calc(100vh - 200px);
}

.legal-content h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.legal-content .last-updated {
  color: var(--gray);
  margin-bottom: 3rem;
}

.legal-content h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--black);
}

.legal-content h3 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--black);
}

.legal-content p {
  color: var(--gray-dark);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.legal-content ul,
.legal-content ol {
  color: var(--gray-dark);
  line-height: 1.8;
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.legal-content li {
  margin-bottom: 0.5rem;
}

.legal-content strong {
  color: var(--black);
}

/* ── Tables (privacy + terms) ───────────────────────────────────────────── */

.legal-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: var(--gray-lightest);
  border-radius: 8px;
  overflow: hidden;
}

.legal-content th,
.legal-content td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-lighter);
}

.legal-content th {
  background: var(--gray-lighter);
  font-weight: 600;
  color: var(--black);
}

.legal-content td {
  color: var(--gray-dark);
}

.legal-content tr:last-child td {
  border-bottom: none;
}

.highlight-box {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(59, 130, 246, 0.05));
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 2rem 0;
}

.highlight-box p {
  color: var(--black);
  font-weight: 500;
  margin: 0;
}

.summary-table {
  background: var(--gray-lightest);
}

.summary-table td:last-child {
  font-weight: 600;
}

/* ── Back link ──────────────────────────────────────────────────────────── */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  text-decoration: none;
  margin-bottom: 2rem;
  font-weight: 500;
}

.back-link:hover {
  text-decoration: underline;
}

html[dir="rtl"] .back-link svg {
  transform: rotate(180deg);
}

/* ── Report form ────────────────────────────────────────────────────────── */
/* The form is the only interactive surface on the site, and it is the first
 * thing AltFlag ever asks a user to fill in -- so it is styled to look
 * deliberate rather than defaulted. Constrained to a readable measure: a
 * full-width text input invites a full-width answer, and the expected input is
 * a hostname. */

#report-form {
  max-width: 32rem;
  margin-top: 2.5rem;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.75rem;
}

.form-row label {
  font-weight: 600;
  color: var(--black);
  font-size: 0.95rem;
}

.form-row input[type="text"],
.form-row select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  font: inherit;
  font-size: 1rem;
  color: var(--black);
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-row input[type="text"]::placeholder {
  color: var(--gray);
}

.form-row input[type="text"]:focus,
.form-row select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}

/* Visible focus for keyboard users on every control, not just the styled ones. */
.form-row input[type="text"]:focus-visible,
.form-row select:focus-visible,
#report-submit:focus-visible,
.back-link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.form-row small,
.form-hint {
  color: var(--gray);
  font-size: 0.85rem;
  line-height: 1.5;
}

#report-submit {
  padding: 0.75rem 1.6rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  background: var(--primary);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

#report-submit:hover:not(:disabled) {
  background: var(--primary-dark);
}

#report-submit:disabled {
  background: var(--gray-light);
  cursor: not-allowed;
}

/* ── Report page copy ───────────────────────────────────────────────────── */

.report-privacy-note {
  padding: 0.9rem 1.1rem;
  background: var(--gray-lightest);
  border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0;
  color: var(--gray-dark);
}

.report-footnote {
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--gray);
}

/* Status line. Hidden until the form has something to say, so an empty element
 * never reserves space above the button. */
.report-status {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
}

.report-status:empty {
  display: none;
}

.report-status.is-error {
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger);
}

.report-status.is-success {
  background: var(--success-subtle);
  color: var(--success);
}

html[dir="rtl"] .report-privacy-note {
  border-left: none;
  border-right: 3px solid var(--primary);
  border-radius: 8px 0 0 8px;
}

@media (max-width: 640px) {
  .legal-content {
    padding: 90px 0 60px;
  }

  .legal-content h1 {
    font-size: 2rem;
  }
}
