/* public/css/public.css
   Shared styling for the two pages ordinary app users (not admins) see:
   the feedback form and the app-link redirect page. Same design tokens
   as admin.css (lifted from the app's own theme.ts) so every surface
   under this domain feels like one product - but its own file, since
   these pages don't share admin.css's sidebar/table/dashboard rules. */

:root {
  --ground: #0a0f1c;
  --ground-alt: #0f1626;
  --surface: rgba(14, 20, 34, 0.88);
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.22);
  --ink: #f2f5f9;
  --ink-soft: #aec3e8;
  --ink-faint: #7c8cae;
  --blue: #0082b0;
  --blue-strong: #00688d;
  --teal: #38d9c9;
  --green: #3ecf8e;
  --rose: #f0819c;
  --on-accent: #08101f;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(
      circle at 15% -10%,
      rgba(0, 130, 176, 0.18),
      transparent 45%
    ),
    radial-gradient(circle at 100% 10%, rgba(56, 217, 201, 0.12), transparent 40%),
    var(--ground);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--on-accent);
  font-size: 17px;
  flex-shrink: 0;
}

.public-card {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 34px 32px;
}

.public-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.public-header h1 {
  font-size: 19px;
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.public-card > p.lede {
  color: var(--ink-faint);
  font-size: 13.5px;
  margin: 6px 0 26px;
  line-height: 1.5;
}

label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

label .optional {
  color: var(--ink-faint);
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
}

.field {
  margin-bottom: 18px;
}

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  background: var(--ground-alt);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--blue);
}

.file-drop {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  cursor: pointer;
  background: var(--ground-alt);
  transition: border-color 0.15s ease;
}

.file-drop:hover {
  border-color: var(--blue);
}

.file-drop input {
  display: none;
}

.file-drop .file-drop-label {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 600;
}

.file-preview {
  margin-top: 12px;
  display: none;
  align-items: center;
  gap: 10px;
}

.file-preview img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.file-preview .file-name {
  font-size: 12.5px;
  color: var(--ink-faint);
  overflow-wrap: anywhere;
}

.btn-primary {
  display: block;
  width: 100%;
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  background: var(--blue);
  color: #fff;
  margin-top: 6px;
}

.btn-primary:hover {
  background: var(--blue-strong);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: default;
}

.flash {
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 18px;
  border: 1px solid transparent;
}

.flash-error {
  background: rgba(240, 129, 156, 0.12);
  border-color: rgba(240, 129, 156, 0.35);
  color: var(--rose);
}

/* ---- Feedback: success state ------------------------------------------- */

.success-panel {
  display: none;
  text-align: center;
  padding: 10px 0 4px;
}

.success-panel .check {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(62, 207, 142, 0.14);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}

.success-panel h2 {
  font-size: 17px;
  margin: 0 0 8px;
}

.success-panel p {
  color: var(--ink-faint);
  font-size: 13.5px;
  margin: 0 0 22px;
  line-height: 1.5;
}

.success-panel .btn-ghost {
  display: inline-flex;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--ink-soft);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.success-panel .btn-ghost:hover {
  color: var(--ink);
  border-color: var(--ink-soft);
}

/* ---- Redirect page ------------------------------------------------------ */

.redirect-card {
  text-align: center;
  max-width: 380px;
}

.redirect-card .brand-mark {
  margin: 0 auto 22px;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  font-size: 23px;
}

.redirect-card h1 {
  font-size: 19px;
  margin: 0 0 8px;
}

.redirect-card p {
  color: var(--ink-faint);
  font-size: 13.5px;
  margin: 0 0 26px;
  line-height: 1.5;
}

.spinner {
  width: 30px;
  height: 30px;
  margin: 0 auto 26px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  animation: spin 0.8s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
    border-top-color: var(--border);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.redirect-card .fallback-link {
  display: inline-block;
  color: var(--teal);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.redirect-card .fallback-link:hover {
  border-bottom-color: var(--teal);
}

/* ---- Legal pages (/privacy, /delete-account) ---------------------------- */

body.doc-page {
  align-items: flex-start;
  padding: 40px 16px 64px;
}

.public-card.doc {
  max-width: 760px;
  padding: 36px 40px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-soft);
}

.doc .public-header h1 {
  font-size: 24px;
  color: var(--ink);
}

.doc .doc-meta {
  color: var(--ink-faint);
  font-size: 13px;
  margin: 8px 0 22px;
}

.doc h2 {
  color: var(--ink);
  font-size: 18px;
  margin: 34px 0 10px;
  scroll-margin-top: 24px;
}

.doc h3 {
  color: var(--ink);
  font-size: 15px;
  margin: 20px 0 6px;
}

.doc p,
.doc ul,
.doc ol {
  margin: 0 0 12px;
}

.doc ul,
.doc ol {
  padding-left: 22px;
}

.doc li {
  margin-bottom: 6px;
}

.doc strong {
  color: var(--ink);
}

.doc a {
  color: var(--teal);
  text-decoration: none;
  border-bottom: 1px solid rgba(56, 217, 201, 0.35);
}

.doc a:hover {
  border-bottom-color: var(--teal);
}

.doc-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
}

.doc .doc-toc a {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12.5px;
  color: var(--ink-soft);
  background: var(--ground-alt);
}

.doc .option {
  border: 1px solid var(--border);
  background: var(--ground-alt);
  border-radius: var(--radius-md);
  padding: 18px 20px 8px;
  margin: 18px 0;
}

.doc .option h2 {
  margin: 8px 0 10px;
}

.option-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--green);
}

.doc .steps li::marker {
  color: var(--teal);
  font-weight: 700;
}

.doc .note {
  font-size: 13.5px;
  color: var(--ink-faint);
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 6px 0 18px;
  font-size: 14px;
}

.doc-table th,
.doc-table td {
  text-align: left;
  vertical-align: top;
  padding: 12px 10px;
  border-top: 1px solid var(--border);
}

.doc-table th {
  color: var(--ink);
  width: 140px;
  white-space: nowrap;
}

.doc-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
}

@media (max-width: 560px) {
  .public-card.doc {
    padding: 26px 20px;
  }
  .doc-table th {
    width: auto;
    white-space: normal;
  }
}

/* ---- Feedback: topic picker ------------------------------------------- */

fieldset.category-field {
  border: 0;
  padding: 0;
  margin: 0 0 18px;
  min-width: 0;
}

.category-field legend {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
  padding: 0;
}

.category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

label.category-option {
  position: relative;
  margin: 0;
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
}

.category-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.category-option span {
  display: block;
  height: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--ground-alt);
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 600;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.category-option:hover span {
  border-color: var(--border-strong);
}

.category-option input:checked + span {
  border-color: var(--teal);
  background: rgba(56, 217, 201, 0.1);
  color: var(--ink);
}

.category-option input:focus-visible + span {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.notice {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
  background: rgba(240, 185, 77, 0.08);
  border: 1px solid rgba(240, 185, 77, 0.35);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: -4px 0 18px;
}

.notice strong {
  color: var(--ink);
}

.notice a,
.form-foot a {
  color: var(--teal);
}

.notice[hidden],
.field[hidden] {
  display: none;
}

.form-foot {
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-faint);
  margin: 14px 0 0;
}

@media (max-width: 380px) {
  .category-grid {
    grid-template-columns: 1fr;
  }
}
