@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-alt: #eef3f9;
  --text: #0f172a;
  --muted: #64748b;
  --line: #dbe3ef;
  --primary: #0e3e5f;
  --primary-2: #1a5580;
  --accent: #c8a84b;
  --accent-2: #e8c870;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
  --radius: 24px;
  --radius-lg: 30px;
  --radius-sm: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(200, 168, 75, 0.15), transparent 25%),
    linear-gradient(180deg, #f8fafc 0%, #f4f7fb 100%);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.topbar,
.page-header,
.login-card,
.card,
.panel,
.stat-card,
.question-builder,
.response-table-wrap,
.survey-shell,
.empty-state {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(219, 227, 239, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.topbar {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  margin-bottom: 24px;
}

.brand h1,
.page-header h1,
.card h2,
.panel h2,
.login-card h1,
.survey-title {
  margin: 0;
  letter-spacing: -0.03em;
}

.brand small,
.subtitle,
.text-muted,
.helper,
.meta-list small,
.survey-description,
.badge-muted {
  color: var(--muted);
}

.actions,
.inline-actions,
.list-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn,
.btn-linklike {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
  text-decoration: none;
  font-weight: 700;
}

.btn:hover,
.btn-linklike:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 12px 30px rgba(26, 85, 128, 0.25);
}

.btn-secondary {
  color: var(--primary);
  background: #eef4fb;
}

.btn-accent {
  color: #0f172a;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 30px rgba(200, 168, 75, 0.28);
}

.btn-danger {
  color: #fff;
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.btn-ghost {
  color: var(--text);
  background: rgba(241, 245, 249, 0.8);
  border: 1px solid var(--line);
}

.btn-sm {
  padding: 9px 14px;
  font-size: 0.92rem;
}

.grid {
  display: grid;
  gap: 22px;
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card,
.panel,
.login-card,
.page-header,
.question-builder,
.response-table-wrap,
.survey-shell,
.empty-state {
  padding: 24px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.flash {
  padding: 14px 18px;
  border-radius: 16px;
  margin-bottom: 18px;
  font-weight: 600;
}
.flash.success { background: rgba(34, 197, 94, 0.12); color: #166534; border: 1px solid rgba(34, 197, 94, 0.2); }
.flash.error { background: rgba(239, 68, 68, 0.12); color: #991b1b; border: 1px solid rgba(239, 68, 68, 0.2); }

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(460px, 100%);
}

label {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.field,
textarea,
select,
input[type="text"],
input[type="url"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="number"] {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 14px 16px;
  color: var(--text);
  transition: border-color .2s ease, box-shadow .2s ease;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.field:focus,
textarea:focus,
select:focus,
input:focus {
  outline: none;
  border-color: rgba(26, 85, 128, 0.45);
  box-shadow: 0 0 0 4px rgba(26, 85, 128, 0.12);
}

.form-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.form-grid .full { grid-column: 1 / -1; }

.checkbox-row {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 600;
  margin-top: 6px;
}
.checkbox-row input { width: auto; }

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

thead th {
  background: #f8fafc;
  color: var(--muted);
  text-align: left;
  font-size: 0.85rem;
  font-weight: 700;
}

th, td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

tbody tr:hover { background: rgba(241, 245, 249, 0.7); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  background: #eef4fb;
  color: var(--primary);
}
.badge.success { background: rgba(22, 163, 74, 0.12); color: #166534; }
.badge.error { background: rgba(220, 38, 38, 0.1); color: #991b1b; }
.badge.warning { background: rgba(217, 119, 6, 0.12); color: #92400e; }

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  padding: 20px;
}

.stat-card strong {
  display: block;
  font-size: 1.9rem;
  margin-top: 10px;
}

.meta-list {
  display: grid;
  gap: 10px;
}

.meta-item {
  padding: 14px 16px;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.question-builder {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.question-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
}

.question-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.question-card-head strong {
  font-size: 1.05rem;
}

.question-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.helper-box {
  margin-top: 14px;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px dashed rgba(100, 116, 139, 0.35);
  padding: 14px 16px;
  color: var(--muted);
}

.survey-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.survey-shell {
  width: min(760px, 100%);
}

.progress-wrap {
  margin-bottom: 22px;
}

.progress-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.92rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.progress-bar {
  width: 100%;
  height: 10px;
  background: #e8eef7;
  border-radius: 999px;
  overflow: hidden;
}

.progress-value {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  transition: width .35s ease;
}

.survey-step {
  min-height: 280px;
  opacity: 0;
  transform: translateY(10px);
  animation: stepIn .35s ease forwards;
}

@keyframes stepIn {
  to { opacity: 1; transform: translateY(0); }
}

.question-type {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.85rem;
}

.question-title {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  line-height: 1.1;
  margin: 0 0 12px;
}

.answer-wrap {
  margin-top: 28px;
}

.option-list {
  display: grid;
  gap: 12px;
}

.option-item {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
  background: #fff;
}

.option-item:hover {
  border-color: rgba(26, 85, 128, 0.35);
  transform: translateY(-1px);
}

.option-item.active {
  background: rgba(26, 85, 128, 0.08);
  border-color: rgba(26, 85, 128, 0.45);
}

.option-item input { display: none; }

.survey-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.final-box {
  text-align: center;
  display: grid;
  gap: 18px;
}

.share-box {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background: #f8fafc;
}

.code-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 14px 16px;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 16px;
  word-break: break-word;
  text-align: left;
}

.hidden-honeypot {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  height: 1px !important;
  width: 1px !important;
  overflow: hidden !important;
}

.empty-state {
  text-align: center;
}

hr.separator {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 28px 0;
}

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

.chart-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  padding: 18px;
}

.chart-card canvas {
  width: 100% !important;
  height: 320px !important;
}

.response-chip {
  display: inline-flex;
  margin: 6px 6px 0 0;
  padding: 8px 10px;
  border-radius: 999px;
  background: #eef4fb;
  color: var(--primary);
  font-size: .88rem;
}

.small-note {
  font-size: 0.87rem;
  color: var(--muted);
}

@media (max-width: 900px) {
  .grid-2,
  .grid-3,
  .form-grid,
  .chart-grid,
  .kpis {
    grid-template-columns: 1fr;
  }

  .page-header,
  .topbar,
  .survey-footer,
  .question-card-head {
    flex-direction: column;
    align-items: stretch;
  }

  .container {
    width: min(100% - 20px, 1120px);
    padding: 20px 0 40px;
  }

  .card,
  .panel,
  .survey-shell,
  .login-card,
  .page-header,
  .question-builder,
  .response-table-wrap,
  .empty-state,
  .topbar {
    border-radius: 22px;
    padding: 20px;
  }

  table { min-width: 620px; }
}
