@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');

/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --primary:       #D97757;
  --primary-hover: #C4623E;
  --primary-light: #FEF0EB;
  --primary-ring:  rgba(217,119,87,.18);
  --bg:            #F9F7F5;
  --card:          #ffffff;
  --text:          #1A1410;
  --text-muted:    #6B5E56;
  --text-light:    #A8998F;
  --border:        #E8E0DA;
  --border-focus:  #D97757;
  --success:       #2D9E6B;
  --success-light: #D6F5E8;
  --danger:        #D94F3D;
  --danger-light:  #FDECEA;
  --warning:       #E8A020;
  --warning-light: #FEF3D5;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 3px 8px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.05);
  --shadow-lg: 0 8px 20px rgba(0,0,0,.09), 0 3px 6px rgba(0,0,0,.04);

  --radius-sm: 8px;
  --radius:    16px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  --nav-h: 60px;
  --transition: all .18s ease;
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  user-select: none;
  -webkit-user-select: none;
}
input, textarea, [contenteditable] {
  user-select: text;
  -webkit-user-select: text;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font-family: inherit; font-size: inherit; }

/* ── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* ── Typography ────────────────────────────────────────────────────────────── */
h1 { font-size: 2rem;     font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.5rem;   font-weight: 700; line-height: 1.3; }
h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.4; }
h4 { font-size: 1rem;     font-weight: 600; }

/* ── Navbar ────────────────────────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0.75rem; z-index: 100;
  height: var(--nav-h);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 999px;
  display: flex; align-items: center;
  padding: 0 1.375rem;
  gap: 1rem;
  box-shadow: 0 2px 16px rgba(0,0,0,.07), 0 1px 4px rgba(0,0,0,.04);
  margin: 0.75rem auto 0;
  max-width: 680px;
  width: calc(100% - 3rem);
}
.nav-brand {
  display: flex; align-items: center; gap: .5rem;
  font-size: 1rem; font-weight: 800;
  color: var(--text);
  flex-shrink: 0;
  text-decoration: none;
}
.nav-brand .brand-name { color: var(--text); }
.nav-brand .brand-dot  { color: var(--primary); }
.nav-spacer { flex: 1; }
.nav-actions { display: flex; align-items: center; gap: .625rem; }
.nav-user {
  display: flex; align-items: center; gap: .375rem;
  font-size: .875rem; color: var(--text-muted);
}
.nav-user strong { color: var(--text); font-weight: 600; }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .375rem;
  padding: .5rem 1.25rem;
  font-size: .875rem; font-weight: 600;
  border: none; border-radius: 999px;
  cursor: pointer; transition: var(--transition);
  white-space: nowrap; text-decoration: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }

.btn-secondary {
  background: var(--card); color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg); border-color: var(--primary); }

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover:not(:disabled) { background: var(--bg); color: var(--text); }

.btn-danger { background: transparent; color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: var(--danger-light); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #247a52; }

.btn-lg  { padding: .75rem 1.75rem; font-size: 1rem; }
.btn-sm  { padding: .375rem .75rem; font-size: .8125rem; }
.btn-icon { padding: .5rem; border-radius: 50%; }
.btn-full { width: 100%; }

/* ── Forms ─────────────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: .375rem; }
.form-label { font-size: .875rem; font-weight: 600; color: var(--text); }
.form-label span { color: var(--danger); margin-left: .125rem; }
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: .625rem .875rem;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: var(--transition);
  outline: none;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-light); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-hint    { font-size: .8125rem; color: var(--text-muted); }
.form-error   { font-size: .8125rem; color: var(--danger); display: flex; align-items: center; gap: .25rem; }
.form-success { font-size: .8125rem; color: var(--success); }
.form-input.is-invalid { border-color: var(--danger); }
.form-input.is-valid   { border-color: var(--success); }

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.card-body { padding: 1.25rem; }
.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: .75rem;
}
.card-footer {
  padding: .875rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ── Badges ────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .2rem .625rem;
  font-size: .75rem; font-weight: 600;
  border-radius: 99px;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger  { background: var(--danger-light);  color: var(--danger);  }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-neutral { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }

/* ── Alerts ────────────────────────────────────────────────────────────────── */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  display: flex; align-items: flex-start; gap: .5rem;
  border: 1px solid transparent;
}
.alert-danger  { background: var(--danger-light);  color: #a33; border-color: #f5c0bc; }
.alert-success { background: var(--success-light); color: #1a5c3a; border-color: #9ce4c6; }
.alert-warning { background: var(--warning-light); color: #7a4f00; border-color: #f5d77a; }

/* ── Toggle ────────────────────────────────────────────────────────────────── */
.toggle-wrap { display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.toggle {
  position: relative;
  width: 38px; height: 21px;
  background: var(--border);
  border-radius: 99px;
  transition: var(--transition); flex-shrink: 0;
}
.toggle::after {
  content: '';
  position: absolute; top: 3px; left: 3px;
  width: 15px; height: 15px;
  background: #fff;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.toggle.on { background: var(--success); }
.toggle.on::after { transform: translateX(17px); }

/* ── Modal ─────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; visibility: hidden;
  transition: var(--transition);
}
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 480px;
  overflow: hidden;
}
.modal-header {
  padding: 1.125rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 1rem; font-weight: 700; }
.modal-body  { padding: 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: .75rem;
}

/* ── Toast ─────────────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  z-index: 300;
  display: flex; flex-direction: column; gap: .5rem;
}
.toast {
  display: flex; align-items: center; gap: .625rem;
  padding: .75rem 1rem;
  background: #2a1f18;
  color: #fff;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-size: .875rem; font-weight: 500;
  min-width: 220px;
}
.toast.toast-success { background: var(--success); }
.toast.toast-danger  { background: var(--danger); }
.toast.toast-warning { background: var(--warning); color: var(--text); }

/* ── Page layout ───────────────────────────────────────────────────────────── */
.page-wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap;
}
.page-title    { font-size: 1.375rem; font-weight: 700; }
.page-subtitle { font-size: .875rem; color: var(--text-muted); margin-top: .25rem; }

/* ── Auth pages ────────────────────────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}
.auth-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  width: 100%; max-width: 440px;
  overflow: hidden;
  position: relative; z-index: 1;
}

/* ── Auth background text animation ────────────────────────────────────────── */
.auth-bg-text {
  position: absolute;
  top: -100%; left: -50%;
  width: 300%; height: 400%;
  pointer-events: none; z-index: 0;
  transform: rotate(-45deg);
  display: flex; flex-direction: column;
  gap: 2.75rem;
  opacity: 0.055;
  color: var(--primary);
  font-size: .875rem; font-weight: 700;
  letter-spacing: .12em;
  user-select: none;
  animation: authTextFlow 24s linear infinite;
}
.auth-bg-row { white-space: nowrap; flex-shrink: 0; }
.auth-bg-row:nth-child(even) { margin-left: 9rem; }
@keyframes authTextFlow {
  from { transform: rotate(-45deg) translateX(0); }
  to   { transform: rotate(-45deg) translateX(-28rem); }
}
.auth-top {
  padding: 1.5rem 1.75rem .25rem;
  display: flex; align-items: center; justify-content: space-between;
}
.auth-brand {
  font-size: .875rem; font-weight: 800;
  color: var(--text);
  display: flex; align-items: center; gap: .4rem;
  text-decoration: none;
}
.auth-brand .brand-dot { color: var(--primary); }
.auth-body { padding: 1.5rem 1.75rem 1.75rem; }
.auth-body-title {
  font-size: 1.25rem; font-weight: 700;
  color: var(--text); margin-bottom: .25rem;
}
.auth-body-sub {
  font-size: .875rem; color: var(--text-muted);
  margin-bottom: 1.75rem;
}
.auth-footer {
  text-align: center;
  padding: 1rem 1.75rem;
  border-top: 1px solid var(--border);
  font-size: .875rem; color: var(--text-muted);
  background: var(--bg);
}
.auth-footer a { color: var(--primary); font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

/* ── Step indicator ────────────────────────────────────────────────────────── */
.step-indicator {
  display: flex; align-items: center;
  margin-bottom: 1.75rem;
}
.step-item {
  display: flex; flex-direction: column; align-items: center;
  gap: .3rem; flex: 1;
  position: relative;
}
.step-item:not(:last-child)::after {
  content: '';
  position: absolute; top: 15px; left: 50%;
  width: 100%; height: 1.5px;
  background: var(--border);
  z-index: 0;
  transition: var(--transition);
}
.step-item.done:not(:last-child)::after { background: var(--primary); }
.step-circle {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--card);
  display: flex; align-items: center; justify-content: center;
  font-size: .8125rem; font-weight: 700;
  color: var(--text-muted);
  z-index: 1; position: relative;
  transition: var(--transition);
}
.step-item.active .step-circle {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.step-item.done .step-circle {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.step-label {
  font-size: .6875rem; font-weight: 600;
  color: var(--text-muted);
  text-align: center; white-space: nowrap;
}
.step-item.active .step-label,
.step-item.done .step-label   { color: var(--primary); }

/* ── Step panels ───────────────────────────────────────────────────────────── */
.step-panel { display: none; }
.step-panel.active { display: block; }

/* ── Terms ─────────────────────────────────────────────────────────────────── */
.terms-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .875rem;
  background: var(--bg);
  max-height: 130px; overflow-y: auto;
  font-size: .8125rem; color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: .625rem;
}
.checkbox-wrap {
  display: flex; align-items: center; gap: .625rem;
  cursor: pointer; padding: .4rem 0;
}
.checkbox-wrap input[type=checkbox] { display: none; }
.checkbox-box {
  width: 19px; height: 19px;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  background: var(--card);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition); flex-shrink: 0;
}
.checkbox-wrap input:checked + .checkbox-box {
  background: var(--primary); border-color: var(--primary);
}
.checkbox-wrap input:checked + .checkbox-box::after {
  content: '✓'; color: #fff; font-size: .75rem; font-weight: 700;
}
.checkbox-label { font-size: .875rem; user-select: none; }

/* ── Dashboard ─────────────────────────────────────────────────────────────── */
.survey-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.125rem;
}
.survey-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: border-color var(--transition);
  display: flex; flex-direction: column;
  position: relative;
}
.survey-card:hover { border-color: var(--primary); }
.survey-card-accent { height: 3px; background: var(--primary); border-radius: var(--radius) var(--radius) 0 0; }
.survey-card-body   { display: block; padding: 1.125rem; flex: 1; color: inherit; text-decoration: none; cursor: pointer; }
.survey-card-top {
  display: flex; align-items: flex-start; gap: .375rem; margin-bottom: .3rem;
}
.survey-card-title {
  flex: 1;
  font-size: .9375rem; font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.survey-card-sub {
  font-size: .8125rem; color: var(--text-muted);
  margin-bottom: .875rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.survey-card-meta {
  display: flex; gap: .4rem; flex-wrap: wrap;
}

/* 3-dot card menu */
.card-menu-wrap { position: relative; flex-shrink: 0; }
.card-menu-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-light); font-size: 1.25rem; line-height: 1;
  padding: .125rem .375rem; border-radius: var(--radius-sm);
  transition: var(--transition);
}
.card-menu-btn:hover { background: var(--bg); color: var(--text); }
.card-menu {
  display: none; position: absolute; top: calc(100% + 4px); right: 0;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  z-index: 60; min-width: 150px; padding: .3rem 0;
}
.card-menu.open { display: block; }
.card-menu-item {
  display: block; width: 100%; padding: .5rem 1rem;
  font-size: .875rem; text-align: left; white-space: nowrap;
  background: none; border: none; cursor: pointer;
  color: var(--text); text-decoration: none;
  transition: background var(--transition);
}
.card-menu-item:hover { background: var(--bg); }
.card-menu-danger { color: var(--danger); }
.card-menu-danger:hover { background: var(--danger-light); }
.card-menu-sep { height: 1px; background: var(--border); margin: .3rem 0; }

/* ── Survey Builder ────────────────────────────────────────────────────────── */

.builder-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  max-width: 680px;
  margin: 0 auto;
}
.builder-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.builder-header-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.375rem;
  box-shadow: var(--shadow);
}

/* Question Cards */
.q-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color var(--transition);
}
.q-card:hover { border-color: var(--primary); }
.q-card.dragging { opacity: 0.35; box-shadow: none; }
.q-card.drag-over { border-color: var(--primary); border-style: dashed; background: var(--primary-light); }
.q-drag-handle {
  cursor: grab; color: var(--text-light); font-size: 1.1rem;
  line-height: 1; padding: 0 .25rem; flex-shrink: 0;
  user-select: none; -webkit-user-select: none;
}
.q-drag-handle:active { cursor: grabbing; }
.q-card-header {
  padding: .75rem 1rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: .625rem;
}
.q-type-badge {
  display: flex; align-items: center; gap: .3rem;
  padding: .2rem .6rem;
  border-radius: 99px;
  font-size: .75rem; font-weight: 700;
}
.q-type-checkbox     { background: #FEF0EB; color: var(--primary); }
.q-type-radio        { background: #FEF3D5; color: #A0680A; }
.q-type-text         { background: #DDFAED; color: #1C7A49; }
.q-type-textarea     { background: #DDFAED; color: #1C7A49; }
.q-type-number       { background: #FDECEA; color: var(--danger); }
.q-type-rating       { background: #fef9c3; color: #a16207; }
.q-type-description  { background: #f3f4f6; color: #374151; }

/* Rating preview in builder */
.q-rating-preview {
  display: flex; gap: .625rem; margin-top: .875rem; align-items: center;
}
.q-rating-dot {
  width: 38px; height: 38px; border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: .875rem; font-weight: 700; color: var(--text-muted);
  flex-shrink: 0;
}
.q-num { font-size: .8125rem; font-weight: 700; color: var(--text-muted); margin-left: auto; }
.q-card-body { padding: 1rem; }
.q-title-input {
  width: 100%; padding: .5rem .75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9375rem; font-weight: 600;
  background: transparent; outline: none;
  transition: var(--transition);
}
.q-title-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
  background: var(--card);
}
.q-title-input::placeholder { font-weight: 400; }
.q-options { margin-top: .75rem; display: flex; flex-direction: column; gap: .5rem; }
.q-option-row { display: flex; align-items: center; gap: .5rem; }
.q-option-icon { color: var(--text-light); font-size: .875rem; flex-shrink: 0; }
.q-option-input {
  flex: 1; padding: .375rem .625rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .875rem; outline: none;
  transition: var(--transition); background: var(--bg);
}
.q-option-input:focus { border-color: var(--primary); background: var(--card); }
.q-add-option {
  display: flex; align-items: center; gap: .375rem;
  font-size: .8125rem; color: var(--primary); font-weight: 600;
  cursor: pointer; padding: .375rem .5rem;
  border-radius: var(--radius-sm); transition: var(--transition);
  border: none; background: none;
}
.q-add-option:hover { background: var(--primary-light); }
.q-settings {
  margin-top: .75rem; padding-top: .75rem;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.q-settings label {
  display: flex; align-items: center; gap: .375rem;
  font-size: .8125rem; color: var(--text-muted); cursor: pointer;
}
.q-settings input[type=number] {
  width: 70px; padding: .25rem .5rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); outline: none; font-size: .8125rem;
}
.q-settings input[type=number]:focus { border-color: var(--primary); }

/* Add question button */
.add-q-row {
  display: flex; gap: .75rem;
}
.add-q-btn {
  display: flex; align-items: center; justify-content: center; gap: .625rem;
  padding: .875rem;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted); font-size: .9rem; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  flex: 1;
}
.add-q-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
/* Description textarea in builder */
.q-desc-textarea {
  min-height: 80px;
  resize: vertical;
  font-weight: 400;
}

/* Type picker */
.type-picker { display: grid; grid-template-columns: 1fr 1fr; gap: .625rem; }
.type-option {
  display: flex; align-items: center; gap: .625rem;
  padding: .75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer; transition: var(--transition);
  background: var(--bg);
}
.type-option:hover { border-color: var(--primary); background: var(--primary-light); }
.type-option .type-icon {
  width: 34px; height: 34px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.type-option-text { font-size: .875rem; font-weight: 600; }
.type-option-desc { font-size: .75rem; color: var(--text-muted); }

/* ── Rating (take page) ────────────────────────────────────────────────────── */
.take-rating {
  display: flex; gap: .75rem; align-items: center;
  flex-wrap: wrap; margin: .375rem 0;
}
.take-rating-btn {
  width: 52px; height: 52px; border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg);
  font-size: 1.0625rem; font-weight: 700; color: var(--text-muted);
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.take-rating-btn:hover  { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.take-rating-btn.selected { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 2px 10px rgba(217,119,87,.35); }
.take-rating-labels {
  display: flex; justify-content: space-between;
  font-size: .75rem; color: var(--text-light);
  margin-top: .25rem; padding: 0 .25rem;
}

/* ── Survey Take ───────────────────────────────────────────────────────────── */
.take-desc-block {
  padding: .25rem 0 .75rem;
  margin-bottom: .25rem;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.4;
}
.take-wrap {
  max-width: 660px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}
.take-header {
  text-align: center;
  margin-bottom: 1.75rem;
  padding: 1.75rem 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.take-header h1 { font-size: 1.375rem; margin-bottom: .375rem; color: var(--text); }
.take-header p  { font-size: .9rem; color: var(--text-muted); }
.take-header-bar {
  height: 3px; background: var(--primary);
  border-radius: var(--radius) var(--radius) 0 0;
  margin: -1.75rem -1.5rem 1.25rem;
}
.take-question {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow);
  padding: 1.125rem;
  margin-bottom: .875rem;
  transition: border-color var(--transition);
}
.take-question:focus-within { border-color: var(--primary); }
.take-q-title { font-size: .9375rem; font-weight: 700; margin-bottom: .875rem; }
.take-options { display: flex; flex-direction: column; gap: .5rem; }
.take-option {
  display: flex; align-items: center; gap: .625rem;
  padding: .625rem .875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer; transition: var(--transition);
  font-size: .9rem;
}
.take-option:hover   { border-color: var(--primary); background: var(--primary-light); }
.take-option.selected { border-color: var(--primary); background: var(--primary-light); font-weight: 600; color: var(--primary-hover); }
.take-option input { display: none; }
.take-option-dot {
  width: 17px; height: 17px; border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: var(--transition);
}
.take-option.selected .take-option-dot { border-color: var(--primary); background: var(--primary); }
.take-option.selected .take-option-dot::after {
  content: ''; width: 5px; height: 5px; background: #fff; border-radius: 50%;
}
.take-option-check {
  width: 17px; height: 17px; border-radius: 4px;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: var(--transition);
}
.take-option.selected .take-option-check { border-color: var(--primary); background: var(--primary); }
.take-option.selected .take-option-check::after {
  content: '✓'; color: #fff; font-size: .7rem; font-weight: 700;
}
.take-submit { margin-top: 1.75rem; text-align: center; }
.take-done {
  text-align: center; padding: 3rem 1.5rem;
  background: var(--card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.take-done .done-icon {
  font-size: 2rem; margin-bottom: 1rem;
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--success-light); color: var(--success);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.25rem;
  font-weight: 700;
}
.take-done h2 { margin-bottom: .5rem; }
.take-done > p { color: var(--text-muted); }
.take-done-promo {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; gap: 1.25rem;
}
.take-done-promo p { font-size: .875rem; color: var(--text-muted); margin: 0; }

/* ── Stats ─────────────────────────────────────────────────────────────────── */
.stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .875rem;
  margin-bottom: 1.75rem;
}
.stat-box {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.125rem;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-box .stat-val {
  font-size: 1.875rem; font-weight: 800;
  color: var(--primary); line-height: 1;
  margin-bottom: .25rem;
}
.stat-box .stat-label { font-size: .8125rem; color: var(--text-muted); }
.stats-question {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 1.125rem;
  overflow: hidden;
}
.stats-q-header {
  padding: .875rem 1.125rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.stats-q-title { font-size: .9375rem; font-weight: 700; }
.stats-q-count { font-size: .8125rem; color: var(--text-muted); flex-shrink: 0; }
.chart-type-btns { display: flex; gap: .3rem; flex-wrap: wrap; }
.chart-type-btn {
  padding: .275rem .65rem;
  border: 1.5px solid var(--border);
  border-radius: 99px;
  font-size: .75rem; font-weight: 600; cursor: pointer;
  background: var(--bg); color: var(--text-muted);
  transition: var(--transition);
}
.chart-type-btn:hover  { border-color: var(--primary); color: var(--primary); }
.chart-type-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.stats-q-body  { padding: 1.125rem; }
.chart-wrap    { position: relative; max-height: 320px; }
.chart-wrap canvas { max-height: 320px; }
.num-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: .625rem;
  margin-bottom: 1rem;
}
.num-stat-box {
  background: var(--bg); border-radius: var(--radius-sm);
  padding: .75rem; text-align: center;
  border: 1px solid var(--border);
}
.num-stat-val   { font-size: 1.25rem; font-weight: 800; color: var(--primary); }
.num-stat-label { font-size: .75rem; color: var(--text-muted); }
.text-answers-list {
  display: flex; flex-direction: column; gap: .5rem;
  max-height: 340px; overflow-y: auto;
}
.text-answer-item {
  padding: .5rem .875rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  border-left: 3px solid var(--primary);
}

/* ── Index / Hero ──────────────────────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden;
  min-height: calc(100vh - var(--nav-h));
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem;
  background: var(--bg);
}
/* Soft radial glow blob — the only decoration on this page */
.hero-glow {
  position: absolute;
  top: 38%; left: 50%;
  width: 660px; height: 440px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center,
    rgba(217,119,87,.16) 0%,
    rgba(217,119,87,.06) 45%,
    transparent 70%);
  transform: translate(-50%, -50%);
  animation: glowBreath 6s ease-in-out infinite;
  pointer-events: none; z-index: 0;
}
@keyframes glowBreath {
  0%, 100% { opacity: .65; transform: translate(-50%, -50%) scale(1);    }
  50%       { opacity: 1;   transform: translate(-50%, -50%) scale(1.18); }
}
.hero-inner { position: relative; z-index: 1; max-width: 580px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: .375rem;
  background: var(--primary-light);
  color: var(--primary);
  padding: .35rem .875rem;
  border-radius: 99px;
  font-size: .8125rem; font-weight: 700;
  margin-bottom: 1.375rem;
  border: 1px solid rgba(217,119,87,.2);
}
.hero h1 { font-size: clamp(1.875rem, 4.5vw, 2.875rem); margin-bottom: .875rem; }
.hero h1 span { color: var(--primary); }
.hero p {
  font-size: 1.0625rem; color: var(--text-muted);
  margin-bottom: 2rem; line-height: 1.8;
}
.hero-btns { display: flex; gap: .875rem; justify-content: center; flex-wrap: wrap; }
.hero-btns .btn { border-radius: 999px; }
.features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.125rem; padding: 3.5rem 1.5rem;
  max-width: 960px; margin: 0 auto;
}
.feature-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.375rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: border-color var(--transition);
}
.feature-card:hover { border-color: var(--primary); }
.feature-icon {
  width: 40px; height: 40px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.125rem; margin-bottom: .75rem;
}
.feature-card h3 { margin-bottom: .3rem; }
.feature-card p  { font-size: .875rem; color: var(--text-muted); }

/* ── Empty state ───────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 3.5rem 2rem;
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1.5px dashed var(--border);
}
.empty-icon { font-size: 2.75rem; margin-bottom: 1rem; opacity: .4; }
.empty-state h3 { margin-bottom: .5rem; color: var(--text-muted); }
.empty-state p  { font-size: .875rem; color: var(--text-light); margin-bottom: 1.5rem; }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .page-wrap    { padding: 1.25rem 1rem; }
  .survey-grid  { grid-template-columns: 1fr; }
  .num-stats    { grid-template-columns: repeat(2, 1fr); }
  .type-picker  { grid-template-columns: 1fr 1fr; }
  .page-header  { flex-direction: column; align-items: flex-start; }
  .modal        { max-width: 100%; }
  h1            { font-size: 1.5rem; }
}
@media (max-width: 480px) {
  .auth-body   { padding: 1.375rem 1.25rem 1.5rem; }
  .auth-top    { padding: 1.25rem 1.25rem .25rem; }
  .auth-footer { padding: .875rem 1.25rem; }
  .take-wrap   { padding: 1.25rem 1rem 3rem; }
}

/* ── Utilities ─────────────────────────────────────────────────────────────── */
.flex            { display: flex; }
.items-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .25rem; }  .gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }  .gap-4 { gap: 1rem; }
.mt-1 { margin-top: .25rem; }   .mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: .75rem; }   .mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .25rem; } .mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: .75rem; } .mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.text-sm       { font-size: .875rem; }
.text-xs       { font-size: .8125rem; }
.text-muted    { color: var(--text-muted); }
.text-center   { text-align: center; }
.font-bold     { font-weight: 700; }
.font-semibold { font-weight: 600; }
.w-full        { width: 100%; }
.hidden        { display: none; }
.separator     { height: 1px; background: var(--border); margin: 1.125rem 0; }
.spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
