/* 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);
}
