:root {
  --bg: #07070b;
  --card: rgba(18, 18, 26, .88);
  --border: rgba(255, 255, 255, .09);
  --text: #f8f8fb;
  --muted: #a7a7b5;
  --pink: #ff3f9d;
  --pink-soft: #ff79bd;
  --blue: #38a9ff;
  --green: #20d47b;
  --green-dark: #12a85e;
  --red: #ff4d61;
  --shadow: 0 28px 80px rgba(0,0,0,.45);
  font-family: "Vazirmatn", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 50% 15%, rgba(255, 63, 157, .09), transparent 34rem),
    radial-gradient(circle at 85% 80%, rgba(56, 169, 255, .07), transparent 28rem),
    var(--bg);
  color: var(--text);
}

button, input { font: inherit; }

button { -webkit-tap-highlight-color: transparent; }

.app-shell {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  padding: 22px;
}

.ambient {
  position: fixed;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .16;
  pointer-events: none;
}

.ambient-one { background: var(--pink); top: -120px; left: -100px; }
.ambient-two { background: var(--blue); bottom: -130px; right: -100px; }

.card {
  width: min(100%, 650px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 30px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.questionnaire-card {
  position: relative;
  padding: 34px 24px 28px;
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-heart {
  position: relative;
  width: 82px;
  height: 74px;
  margin: 0 auto 28px;
  filter: drop-shadow(0 0 18px rgba(255,63,157,.18));
  transform: rotate(-45deg);
  animation: softPulse 3.6s ease-in-out infinite;
}

.heart-small { width: 54px; height: 49px; }

.heart-half {
  position: absolute;
  width: 50%;
  height: 100%;
  top: 0;
  overflow: hidden;
}

.heart-half::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  background: currentColor;
  border-radius: 100% 100% 0 100%;
}

.heart-pink { left: 0; color: var(--pink); }
.heart-blue { right: 0; color: var(--blue); }

.heart-pink::before {
  left: 7%;
  transform: rotate(0deg);
  border-radius: 70% 0 0 70%;
}

.heart-blue::before {
  right: 7%;
  transform: scaleX(-1);
  border-radius: 70% 0 0 70%;
}

/* A clean, connected heart is made by overlapping the two colored halves. */
.brand-heart::after {
  content: "";
  position: absolute;
  inset: 17% 25% 12%;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--pink) 0 50%, var(--blue) 50% 100%);
  opacity: .95;
  z-index: -1;
}

@keyframes softPulse {
  0%, 100% { transform: rotate(-45deg) scale(1); }
  50% { transform: rotate(-45deg) scale(1.045); }
}

.question-area {
  width: 100%;
  text-align: center;
}

.question-enter { animation: questionIn .34s ease both; }

@keyframes questionIn {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.question-title {
  margin: 0 auto 24px;
  max-width: 560px;
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  line-height: 1.8;
  font-weight: 700;
}

.question-subtitle {
  color: var(--muted);
  font-size: .92rem;
  margin: -12px 0 20px;
}

.field {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  text-align: right;
}

.field input {
  width: 100%;
  height: 58px;
  border-radius: 17px;
  border: 1px solid rgba(255,255,255,.12);
  outline: none;
  background: rgba(255,255,255,.055);
  color: var(--text);
  padding: 0 18px;
  direction: rtl;
  transition: border-color .2s, box-shadow .2s, background .2s;
}

.field input:focus {
  border-color: rgba(255,63,157,.75);
  box-shadow: 0 0 0 4px rgba(255,63,157,.10);
  background: rgba(255,255,255,.07);
}

.field input[type="number"] { direction: ltr; text-align: center; }

.form-error {
  min-height: 24px;
  margin: 9px 0 0;
  color: #ff8491;
  font-size: .86rem;
}

.actions {
  display: grid;
  gap: 12px;
  width: min(100%, 440px);
  margin: 0 auto;
}

.btn {
  min-height: 55px;
  border: 0;
  border-radius: 17px;
  padding: 13px 20px;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s ease, filter .18s ease, opacity .18s ease, box-shadow .18s ease;
}

.btn:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.99); }
.btn:disabled { cursor: not-allowed; opacity: .38; }

.btn-green {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  box-shadow: 0 10px 30px rgba(32,212,123,.15);
}

.btn-red {
  background: linear-gradient(135deg, #ff5b6e, #d92f45);
  box-shadow: 0 10px 30px rgba(255,77,97,.12);
}

.btn-secondary {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
}

.btn-danger {
  background: rgba(255,77,97,.14);
  border: 1px solid rgba(255,77,97,.22);
  color: #ff9aa5;
}

.two-buttons { grid-template-columns: 1fr 1fr; }

.success-screen {
  display: grid;
  gap: 12px;
  justify-items: center;
}

.success-screen .brand-heart { margin-bottom: 8px; }
.success-title { font-size: clamp(1.3rem, 4vw, 1.8rem); margin: 0; }
.success-note { color: var(--muted); margin: 0; }

.progress-wrap {
  position: absolute;
  top: 19px;
  left: 24px;
  right: 24px;
  display: grid;
  gap: 7px;
  font-size: .72rem;
  color: var(--muted);
}

.progress-track {
  height: 4px;
  border-radius: 99px;
  background: rgba(255,255,255,.07);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pink), var(--blue));
  transition: width .3s ease;
}

.admin-shell { align-items: start; padding-top: 34px; padding-bottom: 34px; }

.admin-card { padding: 30px; }

.admin-heading { text-align: center; margin-bottom: 24px; }
.admin-heading .brand-heart { margin-bottom: 14px; }
.admin-heading h1 { margin: 0 0 7px; }
.admin-heading p { margin: 0; color: var(--muted); }

.admin-card form { display: grid; gap: 10px; max-width: 440px; margin: auto; }
.admin-card label { color: #d8d8e2; font-size: .9rem; }

.dashboard { width: min(100%, 1100px); position: relative; z-index: 1; }
.dashboard-top {
  padding: 24px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.dashboard-top h1 { margin: 0 0 5px; }
.dashboard-top p { margin: 0; color: var(--muted); }
.dashboard-actions { display: flex; gap: 9px; flex-wrap: wrap; }

.submission-list { display: grid; gap: 14px; }

.submission-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 18px 50px rgba(0,0,0,.24);
}

.submission-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}
.submission-id { color: var(--muted); font-size: .78rem; direction: ltr; }
.status {
  border-radius: 999px;
  padding: 5px 10px;
  font-size: .72rem;
  font-weight: 700;
}
.status-sent { background: rgba(32,212,123,.13); color: #63e5a5; }
.status-failed { background: rgba(255,77,97,.13); color: #ff8b98; }
.status-pending { background: rgba(255,194,71,.13); color: #ffd477; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.info-item {
  padding: 12px 13px;
  border-radius: 15px;
  background: rgba(255,255,255,.045);
  min-width: 0;
}

.info-label { color: var(--muted); font-size: .72rem; margin-bottom: 4px; }
.info-value { color: #f1f1f5; font-size: .9rem; word-break: break-word; white-space: pre-wrap; }
.error-box { margin-top: 12px; color: #ff9aa5; font-size: .78rem; }

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.pagination .btn { min-width: 105px; min-height: 45px; padding: 9px 14px; }
.pagination span { align-self: center; color: var(--muted); font-size: .85rem; }

.admin-error { padding: 16px; margin-bottom: 14px; color: #ff9aa5; }

.empty {
  padding: 34px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 560px) {
  .app-shell { padding: 14px; }
  .questionnaire-card { min-height: calc(100svh - 28px); padding: 38px 18px 22px; border-radius: 25px; }
  .brand-heart { width: 72px; height: 65px; margin-bottom: 23px; }
  .two-buttons { grid-template-columns: 1fr; }
  .dashboard-top { align-items: stretch; flex-direction: column; }
  .dashboard-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .dashboard-actions .btn { min-height: 48px; }
  .info-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
