/* ─── Aroun PR Agency — Questionary design system ───────────────────────
   "Reputation, Engineered" — deep ink, brand red, editorial serif. */

:root {
  --ink: #07090F;
  --ink-2: #0B0F1A;
  --panel: #0C101C;
  --panel-2: #101527;
  --red: #EF4051;
  --red-2: #FF8A94;
  --red-dim: rgba(239, 64, 81, .16);
  --ivory: #F2EFE9;
  --muted: #9AA3B2;
  --muted-2: #5B6474;
  --line: rgba(239, 64, 81, .16);
  --line-soft: rgba(242, 239, 233, .08);
  --danger: #E07A5F;
  --ok: #7FB069;
  --radius: 18px;
  --serif: "Cormorant Garamond", "Vazirmatn", Georgia, serif;
  --sans: "Inter", "Vazirmatn", system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--ivory);
  font-family: var(--sans);
  font-weight: 300;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

[dir="rtl"] body, [dir="rtl"] .q-question, [dir="rtl"] .q-title { font-family: "Vazirmatn", var(--sans); }
[dir="rtl"] .q-question { font-weight: 500; letter-spacing: 0; }

::selection { background: var(--red); color: var(--ink); }

/* ─── Aurora background ─────────────────────────────────────────────── */
.bg-aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.bg-aurora::after {
  content: ""; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; }
.orb-1 { width: 560px; height: 560px; background: radial-gradient(circle, rgba(239,64,81,.20), transparent 65%); top: -180px; inset-inline-start: -120px; animation: drift 22s ease-in-out infinite alternate; }
.orb-2 { width: 480px; height: 480px; background: radial-gradient(circle, rgba(64,84,140,.28), transparent 65%); bottom: -160px; inset-inline-end: -100px; animation: drift 28s ease-in-out infinite alternate-reverse; }
.orb-3 { width: 320px; height: 320px; background: radial-gradient(circle, rgba(239,64,81,.10), transparent 65%); top: 45%; inset-inline-start: 55%; animation: drift 34s ease-in-out infinite alternate; }
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(60px, 40px) scale(1.12); }
}

/* ─── Wordmark ──────────────────────────────────────────────────────── */
.wordmark {
  display: inline-flex; align-items: baseline; gap: 10px;
  text-decoration: none; color: var(--ivory);
}
.wordmark-name { font-family: var(--serif); font-size: 24px; font-weight: 600; letter-spacing: 7px; }
.wordmark-sub { font-size: 9px; letter-spacing: 4px; color: var(--muted); font-weight: 500; }
.wordmark-logo { width: 30px; height: 30px; border-radius: 50%; align-self: center; transform: translateY(3px); box-shadow: 0 3px 12px rgba(239,64,81,.35); }

/* ─── Buttons ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--sans); font-size: 14px; font-weight: 600; letter-spacing: .4px;
  padding: 15px 32px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; transition: all .3s cubic-bezier(.22,1,.36,1);
  white-space: nowrap;
}
.btn-red { background: linear-gradient(135deg, var(--red), var(--red-2)); color: #FFFFFF; box-shadow: 0 8px 30px rgba(239,64,81,.25); }
.btn-red:hover { transform: translateY(-2px); box-shadow: 0 14px 38px rgba(239,64,81,.38); }
.btn-red:active { transform: translateY(0); }
.btn-ghost { background: transparent; color: var(--ivory); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--red); color: var(--red-2); }
.btn-sm { padding: 9px 20px; font-size: 12.5px; }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(224,122,95,.4); }
.btn-danger:hover { background: rgba(224,122,95,.1); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }

/* ─── Questionnaire page ────────────────────────────────────────────── */
.q-wrap { max-width: 760px; margin: 0 auto; padding: 48px 24px 80px; }
.q-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 44px; animation: rise .8s cubic-bezier(.22,1,.36,1) both; }
.lang-toggle { display: flex; background: rgba(242,239,233,.05); border: 1px solid var(--line-soft); border-radius: 999px; padding: 4px; }
.lang-toggle button {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 1px;
  padding: 7px 16px; border-radius: 999px; transition: all .3s;
}
.lang-toggle button.active { background: linear-gradient(135deg, var(--red), var(--red-2)); color: #FFFFFF; }

.q-card {
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012));
  border: 1px solid var(--line-soft); border-radius: 26px;
  padding: 52px 56px 44px; backdrop-filter: blur(14px);
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
  animation: rise .9s .1s cubic-bezier(.22,1,.36,1) both;
}
.q-eyebrow { font-size: 11px; letter-spacing: 4px; color: var(--red); font-weight: 600; text-transform: uppercase; margin-bottom: 14px; }
.q-title { font-family: var(--serif); font-size: clamp(32px, 5vw, 46px); font-weight: 500; line-height: 1.12; margin-bottom: 14px; }
.q-desc { color: var(--muted); font-size: 16px; line-height: 1.75; max-width: 560px; }
.q-meta { display: flex; gap: 22px; margin-top: 22px; font-size: 12.5px; color: var(--muted-2); letter-spacing: .5px; }
.q-meta span { display: inline-flex; align-items: center; gap: 7px; }
.q-meta svg { width: 15px; height: 15px; stroke: var(--red); }

.q-progress { height: 3px; background: rgba(242,239,233,.08); border-radius: 99px; margin: 38px 0 8px; overflow: hidden; }
.q-progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--red), var(--red-2)); border-radius: 99px; transition: width .6s cubic-bezier(.22,1,.36,1); box-shadow: 0 0 12px rgba(239,64,81,.6); }
.q-count { font-size: 11.5px; letter-spacing: 2px; color: var(--muted-2); text-align: end; margin-bottom: 34px; }

.q-step { animation: stepIn .55s cubic-bezier(.22,1,.36,1) both; }
.q-step.leaving { animation: stepOut .3s ease both; }
@keyframes stepIn { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes stepOut { to { opacity: 0; transform: translateY(-16px); } }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

.q-question { font-family: var(--serif); font-size: clamp(26px, 4vw, 36px); font-weight: 500; line-height: 1.25; margin-bottom: 10px; }
.q-help { color: var(--muted); font-size: 13.5px; margin-bottom: 26px; }
.q-req { color: var(--red); font-size: 20px; }

.q-input, .q-textarea, .q-select {
  width: 100%; background: rgba(242,239,233,.04); border: 1px solid var(--line-soft);
  border-radius: 14px; color: var(--ivory); font-family: var(--sans); font-size: 16px;
  padding: 16px 20px; outline: none; transition: border-color .3s, box-shadow .3s, background .3s;
}
.q-textarea { min-height: 130px; resize: vertical; line-height: 1.7; }
.q-input:focus, .q-textarea:focus, .q-select:focus { border-color: var(--red); box-shadow: 0 0 0 4px rgba(239,64,81,.12); background: rgba(242,239,233,.06); }
.q-input::placeholder, .q-textarea::placeholder { color: var(--muted-2); }
.q-select { appearance: none; cursor: pointer; }
.q-select option { background: var(--panel); color: var(--ivory); }
.q-error { color: var(--danger); font-size: 13px; margin-top: 12px; min-height: 18px; }

.opt-grid { display: grid; gap: 12px; }
.opt {
  display: flex; align-items: center; gap: 14px; cursor: pointer;
  background: rgba(242,239,233,.03); border: 1px solid var(--line-soft);
  border-radius: 14px; padding: 16px 20px; font-size: 15.5px;
  transition: all .25s cubic-bezier(.22,1,.36,1); user-select: none;
}
.opt:hover { border-color: rgba(239,64,81,.45); transform: translateY(-1px); }
.opt input { display: none; }
.opt .opt-dot {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--muted-2); display: grid; place-items: center; transition: all .25s;
}
.opt .opt-dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #FFFFFF; transform: scale(0); transition: transform .25s cubic-bezier(.34,1.56,.64,1); }
.opt .opt-box { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--muted-2); display: grid; place-items: center; transition: all .25s; }
.opt .opt-box svg { width: 13px; height: 13px; stroke: #FFFFFF; stroke-width: 3; opacity: 0; transform: scale(.4); transition: all .25s; }
.opt.selected { border-color: var(--red); background: rgba(239,64,81,.08); }
.opt.selected .opt-dot { background: linear-gradient(135deg, var(--red), var(--red-2)); border-color: var(--red); }
.opt.selected .opt-dot::after { transform: scale(1); }
.opt.selected .opt-box { background: linear-gradient(135deg, var(--red), var(--red-2)); border-color: var(--red); }
.opt.selected .opt-box svg { opacity: 1; transform: scale(1); }

.scale-row { display: flex; gap: 10px; flex-wrap: wrap; }
.scale-btn {
  flex: 1 1 56px; min-width: 56px; padding: 18px 8px; text-align: center;
  background: rgba(242,239,233,.03); border: 1px solid var(--line-soft); border-radius: 14px;
  font-family: var(--serif); font-size: 24px; color: var(--ivory); cursor: pointer;
  transition: all .25s cubic-bezier(.22,1,.36,1);
}
.scale-btn:hover { border-color: rgba(239,64,81,.5); transform: translateY(-2px); }
.scale-btn.selected { background: linear-gradient(135deg, var(--red), var(--red-2)); color: #FFFFFF; border-color: var(--red); font-weight: 600; box-shadow: 0 10px 26px rgba(239,64,81,.3); }
.scale-labels { display: flex; justify-content: space-between; margin-top: 12px; font-size: 12px; color: var(--muted-2); letter-spacing: .5px; }

.q-nav { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 40px; }
.q-back { background: none; border: 0; color: var(--muted); font-size: 14px; cursor: pointer; padding: 12px 6px; transition: color .3s; font-family: var(--sans); }
.q-back:hover { color: var(--ivory); }
.q-back[hidden] { visibility: hidden; }

/* Review + thank-you */
.review-item { padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.review-item:last-child { border-bottom: 0; }
.review-q { font-size: 12px; letter-spacing: 1.5px; color: var(--muted-2); text-transform: uppercase; margin-bottom: 6px; }
.review-a { font-size: 16px; line-height: 1.65; }
.thanks { text-align: center; padding: 30px 0 10px; }
.thanks-check {
  width: 88px; height: 88px; margin: 0 auto 28px; border-radius: 50%;
  border: 1px solid var(--red); display: grid; place-items: center;
  box-shadow: 0 0 50px rgba(239,64,81,.25), inset 0 0 30px rgba(239,64,81,.08);
  animation: pop .7s cubic-bezier(.34,1.56,.64,1) both;
}
.thanks-check svg { width: 40px; height: 40px; stroke: var(--red); stroke-width: 2.5; fill: none; stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .8s .3s ease forwards; }
@keyframes pop { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.thanks h2 { font-family: var(--serif); font-size: 38px; font-weight: 500; margin-bottom: 12px; }
.thanks p { color: var(--muted); line-height: 1.8; max-width: 440px; margin: 0 auto; }

.q-footer { text-align: center; margin-top: 44px; font-size: 12px; color: var(--muted-2); letter-spacing: 1px; animation: rise .8s .25s both; }
.q-footer a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); }
.q-footer a:hover { color: var(--red-2); }

/* ─── Admin ─────────────────────────────────────────────────────────── */
.admin-body { background: var(--ink-2); }
.admin-top {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px; border-bottom: 1px solid var(--line-soft);
  background: rgba(7,9,15,.82); backdrop-filter: blur(16px);
}
.admin-nav { display: flex; gap: 6px; }
.admin-nav a {
  color: var(--muted); text-decoration: none; font-size: 13.5px; font-weight: 500;
  padding: 9px 18px; border-radius: 999px; transition: all .3s;
}
.admin-nav a:hover { color: var(--ivory); }
.admin-nav a.active { background: rgba(239,64,81,.12); color: var(--red-2); }
.admin-main { max-width: 1180px; margin: 0 auto; padding: 40px 28px 90px; animation: rise .7s both; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 34px; }
.stat {
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.01));
  border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 24px 26px;
}
.stat-num { font-family: var(--serif); font-size: 42px; font-weight: 600; color: var(--red-2); line-height: 1; }
.stat-label { font-size: 11.5px; letter-spacing: 2px; color: var(--muted-2); text-transform: uppercase; margin-top: 10px; }

.panel {
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 28px; margin-bottom: 26px;
}
.panel h2 { font-family: var(--serif); font-size: 26px; font-weight: 500; margin-bottom: 6px; }
.panel .panel-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 22px; line-height: 1.7; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: start; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted-2); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 15px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tr:hover td { background: rgba(255,255,255,.02); }
.tbl .muted { color: var(--muted); font-size: 12.5px; }
.tbl .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.pill { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: 1px; padding: 5px 12px; border-radius: 999px; text-transform: uppercase; }
.pill-new { background: rgba(239,64,81,.14); color: var(--red-2); border: 1px solid rgba(239,64,81,.35); }
.pill-sent { background: rgba(120,150,220,.12); color: #A9BEEF; border: 1px solid rgba(120,150,220,.3); }
.pill-completed, .pill-done { background: rgba(127,176,105,.12); color: #A8D49A; border: 1px solid rgba(127,176,105,.3); }
.pill-pending { background: rgba(242,239,233,.06); color: var(--muted); border: 1px solid var(--line-soft); }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.field label { display: block; font-size: 11.5px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted-2); margin-bottom: 9px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; background: rgba(242,239,233,.04); border: 1px solid var(--line-soft);
  border-radius: 12px; color: var(--ivory); font-family: var(--sans); font-size: 14.5px;
  padding: 13px 16px; outline: none; transition: border-color .3s, box-shadow .3s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--red); box-shadow: 0 0 0 4px rgba(239,64,81,.1); }
.field select option { background: var(--panel); }

.link-box {
  display: flex; gap: 10px; align-items: center; margin-top: 18px;
  background: rgba(239,64,81,.07); border: 1px dashed rgba(239,64,81,.4);
  border-radius: 12px; padding: 14px 16px;
}
.link-box code { flex: 1; font-size: 13px; color: var(--red-2); word-break: break-all; font-family: ui-monospace, monospace; }
.notice { border-radius: 12px; padding: 14px 18px; font-size: 13.5px; line-height: 1.7; margin-top: 16px; }
.notice-warn { background: rgba(224,122,95,.08); border: 1px solid rgba(224,122,95,.3); color: #F0B9A6; }
.notice-ok { background: rgba(127,176,105,.08); border: 1px solid rgba(127,176,105,.3); color: #BFE3B2; }

.response-view { background: rgba(0,0,0,.25); border: 1px solid var(--line-soft); border-radius: 12px; padding: 20px 22px; margin-top: 14px; }
.response-view .review-q { color: var(--red); }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 420px; text-align: center;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.012));
  border: 1px solid var(--line-soft); border-radius: 26px; padding: 52px 44px 44px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5); animation: rise .8s cubic-bezier(.22,1,.36,1) both;
}
.login-card h1 { font-family: var(--serif); font-size: 34px; font-weight: 500; margin: 26px 0 8px; }
.login-card p { color: var(--muted); font-size: 14px; margin-bottom: 30px; }
.login-card .field { text-align: start; margin-bottom: 16px; }
.login-error { color: var(--danger); font-size: 13px; min-height: 20px; margin-bottom: 8px; }

/* Toast */
.toast {
  position: fixed; bottom: 26px; inset-inline-start: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--panel-2); border: 1px solid var(--red); color: var(--ivory);
  padding: 13px 26px; border-radius: 999px; font-size: 13.5px; z-index: 100;
  opacity: 0; pointer-events: none; transition: all .4s cubic-bezier(.22,1,.36,1);
  box-shadow: 0 16px 40px rgba(0,0,0,.5);
}
[dir="rtl"] .toast { transform: translateX(50%) translateY(20px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
[dir="rtl"] .toast.show { transform: translateX(50%) translateY(0); }

.empty { text-align: center; color: var(--muted-2); padding: 44px 20px; font-size: 14px; line-height: 1.8; }
.empty .empty-title { font-family: var(--serif); font-size: 24px; color: var(--muted); margin-bottom: 8px; }

@media (max-width: 640px) {
  .q-card { padding: 36px 24px 32px; }
  .q-wrap { padding-top: 28px; }
  .admin-top { padding: 14px 16px; flex-wrap: wrap; gap: 12px; }
  .admin-main { padding: 26px 16px 70px; }
  .panel { padding: 20px 16px; }
  .tbl th:nth-child(4), .tbl td:nth-child(4) { display: none; }
  .q-nav .btn { flex: 1; }
}
