:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-glow: rgba(37, 99, 235, 0.2);
  --dark: #0f172a;
  --dark-card: rgba(15, 23, 42, 0.85);
  --dark-border: rgba(255, 255, 255, 0.1);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --success: #10b981;
  --bg-gradient: radial-gradient(circle at 50% 0%, #1e293b 0%, #090d16 100%);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  background: #090d16;
  background-image: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Background ambient elements */
.ambient-glow {
  position: fixed;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Header */
header {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--dark-border);
  backdrop-filter: blur(12px);
  background: rgba(9, 13, 22, 0.6);
}

.logo-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.logo-text h1 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.admin-link-btn {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--dark-border);
  transition: var(--transition);
  cursor: pointer;
}

.admin-link-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
}

/* Main Container */
main {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem 1.25rem;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

/* Progress bar */
.progress-container {
  width: 100%;
  margin-bottom: 2rem;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* Card Step */
.card-step {
  background: var(--dark-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--dark-border);
  border-radius: 20px;
  padding: 2.5rem;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.step-badge {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--accent);
  background: rgba(56, 189, 248, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.question-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.6rem;
  letter-spacing: -0.02em;
}

.question-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.5;
}

/* Form controls */
.options-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.option-card {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--dark-border);
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.option-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.option-card.selected {
  background: rgba(37, 99, 235, 0.15);
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
}

.option-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 1rem;
  flex-shrink: 0;
}

.option-card.selected .option-key {
  background: var(--primary);
  color: #fff;
}

.option-label {
  font-size: 0.95rem;
  font-weight: 500;
  flex: 1;
}

/* Likert Matrix */
.likert-group {
  margin-bottom: 1.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 1.25rem;
}

.likert-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.likert-scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
}

.scale-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--dark-border);
  color: var(--text-muted);
  padding: 0.75rem 0.5rem;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
}

.scale-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.scale-btn.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 12px var(--primary-glow);
}

.scale-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* NPS Scale 0 to 10 */
.nps-grid {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.nps-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--dark-border);
  color: var(--text-muted);
  height: 48px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.nps-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
}

.nps-btn.selected {
  background: var(--primary);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 15px var(--primary-glow);
}

/* Inputs & Textareas */
.custom-input, .custom-textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--dark-border);
  border-radius: 12px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  padding: 0.85rem 1.15rem;
  outline: none;
  transition: var(--transition);
}

.custom-textarea {
  min-height: 90px;
  resize: vertical;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.custom-input:focus, .custom-textarea:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.15);
}

.field-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

/* Navigation buttons */
.nav-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  font-family: inherit;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--dark-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Success screen */
.success-screen {
  text-align: center;
  padding: 2rem 1rem;
}

.success-icon {
  width: 72px;
  height: 72px;
  background: rgba(16, 185, 129, 0.15);
  border: 2px solid var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  color: var(--success);
  font-size: 2.2rem;
  animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleIn {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Admin Dashboard */
.admin-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.admin-modal.active {
  display: flex;
}

.admin-window {
  background: #0f172a;
  border: 1px solid var(--dark-border);
  border-radius: 20px;
  max-width: 950px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.admin-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--dark-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-body {
  padding: 1.75rem;
  overflow-y: auto;
  flex: 1;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--dark-border);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 0.25rem;
}

.stat-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--dark-border);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

th {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--dark-border);
  white-space: nowrap;
}

td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  white-space: nowrap;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Responsiveness */
@media (max-width: 640px) {
  .card-step {
    padding: 1.75rem 1.25rem;
  }
  .nps-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .question-title {
    font-size: 1.25rem;
  }
}
