/* Davetiye panel — HTP red/white/black */

:root {
  --red: #89171a;
  --red-bright: #b81e23;
  --red-soft: rgba(137, 23, 26, 0.08);
  --black: #0d0d0f;
  --ink: #1a1a1d;
  --grey: #55555c;
  --line: #e8e6e4;
  --white: #fff;
  --off: #faf9f8;
  --sans: "Inter", -apple-system, "Segoe UI", sans-serif;
  --display: "Sora", "Inter", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--off);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: var(--mono); }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.01em; }
::selection { background: var(--red); color: var(--white); }

/* ---------- topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 40px);
  background: var(--black);
  color: var(--white);
}

.brand {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--white);
  text-decoration: none;
}
.brand-dot { color: var(--red-bright); }
.brand-sub {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.5);
  margin-left: 8px;
}

.topnav { display: flex; align-items: center; gap: 18px; }
.topnav a { color: rgba(255,255,255,0.85); text-decoration: none; font-size: 0.9rem; font-weight: 600; }
.topnav a:hover { color: var(--white); }
.topnav-user { font-size: 0.75rem; color: rgba(255,255,255,0.45); }
.btn-small {
  background: var(--red);
  padding: 7px 16px;
  border-radius: 999px;
}

/* ---------- layout ---------- */
.page { flex: 1; width: min(880px, 100% - 32px); margin: 0 auto; padding: 48px 0 72px; }
.footer { text-align: center; padding: 20px; font-size: 0.78rem; color: var(--grey); border-top: 1px solid var(--line); }

/* ---------- home ---------- */
.hero-sm { padding: 40px 0; }
.hero-sm.center { text-align: center; }
.eyebrow { color: var(--red); font-size: 0.85rem; margin-bottom: 14px; }
.hero-sm h1 { font-size: clamp(1.7rem, 4.6vw, 2.7rem); line-height: 1.15; margin-bottom: 18px; }
.accent { color: var(--red); }
.lead { color: var(--grey); max-width: 58ch; margin-bottom: 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 42px; }

.steps { list-style: none; display: grid; gap: 10px; max-width: 460px; }
.steps li {
  display: flex; align-items: center; gap: 14px;
  background: var(--white); border: 1px solid var(--line);
  padding: 13px 18px; border-radius: 12px; font-weight: 600; font-size: 0.95rem;
}
.steps em { color: var(--grey); font-weight: 400; font-style: normal; font-size: 0.85rem; }
.step-num { color: var(--red); font-weight: 700; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: 999px; border: 2px solid transparent;
  font-family: var(--display); font-size: 0.92rem; font-weight: 700;
  text-decoration: none; cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s, background 0.2s, border-color 0.2s;
}
.btn-primary { background: linear-gradient(120deg, var(--red), var(--red-bright)); color: var(--white); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(137,23,26,0.3); }
.btn-primary:disabled { opacity: 0.6; cursor: wait; transform: none; box-shadow: none; }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--white); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-block { width: 100%; }
.btn-danger { border-color: transparent; background: none; color: var(--red); padding: 8px 10px; }
.btn-danger:hover { text-decoration: underline; }

/* ---------- auth ---------- */
.auth-card {
  background: var(--white); border: 1px solid var(--line); border-radius: 16px;
  max-width: 420px; margin: 32px auto; padding: 36px 32px;
  box-shadow: 0 18px 50px rgba(13,13,15,0.06);
}
.auth-card h1 { font-size: 1.5rem; margin-bottom: 8px; }
.auth-note { font-size: 0.85rem; color: var(--grey); margin-bottom: 12px; }
.auth-card form { display: grid; gap: 8px; margin-top: 14px; }
.auth-alt { margin-top: 18px; font-size: 0.88rem; color: var(--grey); }
.auth-alt a { color: var(--red); font-weight: 600; }

label { font-size: 0.85rem; font-weight: 600; margin-top: 8px; }
.hint { color: var(--grey); font-weight: 400; font-size: 0.78rem; }

input[type="text"], input[type="email"], input[type="password"], textarea, select {
  font: inherit; padding: 11px 14px; border: 1.5px solid var(--line);
  border-radius: 10px; background: var(--white); width: 100%;
  transition: border-color 0.2s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--red); }
textarea { resize: vertical; }

.form-error {
  background: var(--red-soft); color: var(--red);
  border-radius: 8px; padding: 10px 14px; font-size: 0.85rem; font-weight: 600;
  margin-top: 10px;
}

/* ---------- panel ---------- */
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.panel-head h1 { font-size: 1.6rem; }

.pages-list { display: grid; gap: 14px; }
.muted { color: var(--grey); }

.page-card {
  background: var(--white); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px 22px;
  display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: center;
  animation: card-in 0.4s var(--ease);
}
@keyframes card-in { from { opacity: 0; transform: translateY(10px); } }

.page-card h3 { font-size: 1.05rem; }
.page-card .slug { font-family: var(--mono); font-size: 0.78rem; color: var(--grey); word-break: break-all; }
.page-card .actions { grid-row: 1 / span 2; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.page-card .error-text { grid-column: 1 / -1; font-size: 0.82rem; color: var(--red); }

.badge {
  display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 4px 12px; border-radius: 999px; text-transform: uppercase;
}
.badge.queued, .badge.generating { background: #fdf3e3; color: #8a5a00; }
.badge.preview { background: #e8f0fe; color: #1a4fa0; }
.badge.published { background: #e6f4ea; color: #137333; }
.badge.failed { background: var(--red-soft); color: var(--red); }

.badge.generating::after, .badge.queued::after {
  content: ""; display: inline-block; width: 9px; height: 9px; margin-left: 7px;
  border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%;
  vertical-align: -1px; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- dialog ---------- */
.dialog {
  /* margin:auto restores centering killed by the * reset */
  margin: auto;
  border: 0; border-radius: 20px; padding: 0;
  width: min(600px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  box-shadow: 0 40px 120px rgba(0,0,0,0.35);
}

.dialog[open] { animation: dialog-pop 0.4s var(--ease); }
.dialog::backdrop {
  background: rgba(13,13,15,0.55);
  backdrop-filter: blur(4px);
  animation: backdrop-in 0.3s ease;
}
@keyframes dialog-pop {
  from { opacity: 0; transform: translateY(28px) scale(0.96); }
}
@keyframes backdrop-in { from { opacity: 0; } }

.dialog form { display: grid; gap: 0; padding: 30px 32px 26px; position: relative; }

.dialog-close {
  position: absolute; top: 16px; right: 16px;
  width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: var(--off); color: var(--grey);
  font-size: 1.3rem; line-height: 1; cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.25s var(--ease);
}
.dialog-close:hover { background: var(--red-soft); color: var(--red); transform: rotate(90deg); }

.dialog-head { margin-bottom: 8px; padding-right: 36px; }
.dialog-head h2 { font-size: 1.35rem; margin-bottom: 8px; }
.dialog-sub { font-size: 0.88rem; color: var(--grey); }
.dialog-sub strong { color: var(--ink); }

/* numbered form steps */
.fstep {
  display: grid; gap: 10px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  margin-top: 14px;
}
.fstep:first-of-type { border-top: 0; }

.fstep-head { display: flex; gap: 14px; align-items: flex-start; }
.fstep-num {
  flex-shrink: 0;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  border: 2px solid var(--red); color: var(--red);
  font-size: 0.72rem; font-weight: 700;
}
.fstep-head h3 { font-size: 0.98rem; }
.fstep-desc { font-size: 0.8rem; color: var(--grey); margin-top: 2px; }

.dialog-note {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--off); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px;
  font-size: 0.8rem; color: var(--grey);
  margin-top: 18px;
}

.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.slug-preview { font-size: 0.78rem; color: var(--grey); }

.dropzone {
  display: grid; justify-items: center; gap: 8px;
  border: 2px dashed var(--line); border-radius: 14px;
  padding: 26px; text-align: center; color: var(--grey);
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s, transform 0.25s var(--ease);
  font-size: 0.9rem;
}
.dropzone-icon { width: 30px; height: 30px; color: var(--red); }
.dropzone:hover, .dropzone:focus, .dropzone.dragover {
  border-color: var(--red); background: var(--red-soft); outline: none;
}
.dropzone.dragover { transform: scale(1.015); }

@media (prefers-reduced-motion: reduce) {
  .dialog[open], .dialog::backdrop { animation: none; }
}

.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumbs .thumb {
  position: relative; width: 74px; height: 74px;
  border-radius: 8px; overflow: hidden; border: 1px solid var(--line);
}
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.thumbs .thumb button {
  position: absolute; top: 2px; right: 2px;
  width: 20px; height: 20px; border: 0; border-radius: 50%;
  background: rgba(13,13,15,0.72); color: #fff; font-size: 12px; line-height: 1;
  cursor: pointer;
}

@media (max-width: 560px) {
  .page-card { grid-template-columns: 1fr; }
  .page-card .actions { grid-row: auto; justify-content: flex-start; }
  .brand-sub { display: none; }
}
