/* ============================================
   HYPERFORZA SURVEY – STYLES
   ============================================ */

:root {
  --red: #fe0000;
  --red-dark: #cc0000;
  --red-glow: rgba(254, 0, 0, 0.25);
  --red-subtle: rgba(254, 0, 0, 0.08);
  --bg: #0a0a0a;
  --bg-card: #111111;
  --bg-card-hover: #1a1a1a;
  --bg-option: #151515;
  --bg-option-hover: #1e1e1e;
  --bg-option-selected: rgba(254, 0, 0, 0.1);
  --border: #222222;
  --border-hover: #333333;
  --border-selected: var(--red);
  --text: #ffffff;
  --text-secondary: #999999;
  --text-muted: #666666;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* ---- RESET ---- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Background pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(254, 0, 0, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(254, 0, 0, 0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ---- PROGRESS BAR ---- */
.progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--border);
  z-index: 1000;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--red), #ff4444);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px var(--red-glow);
}

.progress-text {
  position: fixed;
  top: 10px;
  right: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  z-index: 1001;
  background: var(--bg-card);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

/* ---- FORM LAYOUT ---- */
form {
  position: relative;
  z-index: 1;
}

.form-step {
  display: none;
  animation: fadeIn 0.5s ease;
  min-height: 100vh;
  padding: 60px 20px 40px;
  justify-content: center;
  align-items: flex-start;
  flex-direction: column;
  max-width: 720px;
  margin: 0 auto;
}

.form-step.active {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }

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

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

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

@keyframes checkmark {
  0% {
    stroke-dashoffset: 50;
  }

  100% {
    stroke-dashoffset: 0;
  }
}

/* ---- CARD ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  box-shadow: var(--shadow);
  animation: slideUp 0.5s ease;
}

/* ---- WELCOME ---- */
.welcome-card {
  text-align: center;
  padding: 60px 40px;
}

.logo-container {
  margin-bottom: 32px;
}

.logo {
  width: 220px;
  height: auto;
  filter: drop-shadow(0 0 30px var(--red-glow));
  animation: pulse 3s ease infinite;
}

.logo-small {
  width: 140px;
}

.welcome-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  line-height: 1.2;
}

.text-red {
  color: var(--red);
}

.welcome-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 400px;
  margin: 0 auto 32px;
  line-height: 1.5;
}

.welcome-meta {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 40px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.meta-item svg {
  width: 18px;
  height: 18px;
  color: var(--red);
}

/* ---- SECTION BADGE ---- */
.section-badge {
  display: inline-block;
  padding: 6px 14px;
  background: var(--red-subtle);
  border: 1px solid rgba(254, 0, 0, 0.2);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--red);
  letter-spacing: 0.02em;
  margin-bottom: 24px;
  text-transform: uppercase;
}

/* ---- QUESTIONS ---- */
.question-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.sub-question-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.question-hint {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* ---- OPTIONS GRID ---- */
.options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.large-options {
  gap: 12px;
}

/* ---- OPTION CARD ---- */
.option-card {
  position: relative;
  cursor: pointer;
  display: block;
}

.option-card input[type="radio"],
.option-card input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.option-content {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--bg-option);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.option-card:hover .option-content {
  background: var(--bg-option-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.option-card input:checked+.option-content {
  background: var(--bg-option-selected);
  border-color: var(--red);
  box-shadow: 0 0 0 1px var(--red), 0 4px 16px var(--red-glow);
}

.option-card input:checked+.option-content .option-label {
  color: var(--red);
}

.option-icon {
  font-size: 1.4rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
}

.big-icon {
  font-size: 1.8rem;
  width: 48px;
  height: 48px;
}

.option-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.option-label {
  font-weight: 600;
  font-size: 0.95rem;
  transition: color var(--transition);
}

.option-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ---- CHECKBOX specifics ---- */
.checkbox-card .option-content::after {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 6px;
  margin-left: auto;
  flex-shrink: 0;
  transition: all var(--transition);
}

.checkbox-card input:checked+.option-content::after {
  background: var(--red);
  border-color: var(--red);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size: 14px;
  background-position: center;
  background-repeat: no-repeat;
}

.checkbox-card .option-desc {
  margin-left: 0;
}

/* ---- SELECTION COUNTER ---- */
.selection-counter {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 16px;
  font-weight: 500;
}

/* ---- DIVIDER ---- */
.divider {
  height: 1px;
  background: var(--border);
  margin: 32px 0;
}

/* ---- FIELD GROUP ---- */
.field-group {
  margin-bottom: 0;
}

.field-label {
  display: block;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--text);
}

.number-input {
  max-width: 200px;
  resize: none;
}

/* ---- TEXT INPUT ---- */
.text-input {
  width: 100%;
  padding: 16px 20px;
  background: var(--bg-option);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  transition: all var(--transition);
  line-height: 1.5;
}

.text-input::placeholder {
  color: var(--text-muted);
}

.text-input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
}

/* ---- RANGE SLIDER ---- */
.range-container {
  padding: 16px 0 8px;
}

.pain-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: linear-gradient(90deg, #22c55e, #eab308, var(--red));
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

.pain-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--text);
  border: 3px solid var(--red);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
}

.pain-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.pain-slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--text);
  border: 3px solid var(--red);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.range-value {
  text-align: center;
  font-size: 2rem;
  font-weight: 800;
  color: var(--red);
  margin-top: 12px;
}

/* ---- PAIN WARNING ---- */
.pain-warning {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(254, 0, 0, 0.08);
  border: 1px solid rgba(254, 0, 0, 0.25);
  border-radius: var(--radius-xs);
  margin-top: 16px;
  animation: scaleIn 0.3s ease;
}

.pain-warning svg {
  width: 22px;
  height: 22px;
  color: var(--red);
  flex-shrink: 0;
}

.pain-warning span {
  font-size: 0.85rem;
  color: #ff6666;
  font-weight: 500;
}

/* ---- CONDITIONAL BLOCK ---- */
.conditional-block {
  animation: scaleIn 0.3s ease;
}

/* ---- RPE INFO ---- */
.rpe-info-block {
  margin-top: 24px;
  padding: 24px;
  background: rgba(254, 0, 0, 0.05);
  border: 1px solid rgba(254, 0, 0, 0.15);
  border-radius: var(--radius-sm);
  animation: scaleIn 0.3s ease;
}

.rpe-info-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.rpe-info-header svg {
  width: 22px;
  height: 22px;
  color: var(--red);
}

.rpe-info-header h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--red);
}

.rpe-info-block>p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.rpe-scale {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rpe-item {
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
}

.rpe-num {
  font-weight: 700;
  min-width: 55px;
}

.rpe-easy {
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
}

.rpe-moderate {
  background: rgba(234, 179, 8, 0.1);
  color: #facc15;
}

.rpe-hard {
  background: rgba(249, 115, 22, 0.1);
  color: #fb923c;
}

.rpe-very-hard {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
}

.rpe-max {
  background: rgba(254, 0, 0, 0.1);
  color: var(--red);
}

.rpe-note {
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ---- BUTTONS ---- */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: 24px;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--red);
  color: white;
  box-shadow: 0 4px 16px var(--red-glow);
}

.btn-primary:hover {
  background: var(--red-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--red-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-option);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-option-hover);
  color: var(--text);
  border-color: var(--border-hover);
}

.btn-start {
  padding: 18px 48px;
  font-size: 1.1rem;
  border-radius: 60px;
}

.btn-submit {
  background: linear-gradient(135deg, var(--red), #ff3333);
  padding: 16px 36px;
}

/* ---- THANK YOU ---- */
.thank-you-card {
  animation: scaleIn 0.6s ease;
}

.success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.15);
  border: 2px solid rgba(34, 197, 94, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.success-icon svg {
  width: 40px;
  height: 40px;
  color: #4ade80;
}

.thank-you-details {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.thank-you-details p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  padding: 12px 16px;
  background: var(--bg-option);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  line-height: 1.5;
}

/* ---- VALIDATION/ERROR ---- */
.shake {
  animation: shake 0.5s ease;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-8px);
  }

  40% {
    transform: translateX(8px);
  }

  60% {
    transform: translateX(-4px);
  }

  80% {
    transform: translateX(4px);
  }
}

.error-message {
  color: var(--red);
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 12px;
  text-align: center;
  animation: scaleIn 0.3s ease;
}

/* ---- LOADING SPINNER ---- */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
  .card {
    padding: 28px 20px;
  }

  .welcome-card {
    padding: 40px 24px;
  }

  .welcome-title {
    font-size: 1.6rem;
  }

  .question-title {
    font-size: 1.25rem;
  }

  .sub-question-title {
    font-size: 1.05rem;
  }

  .option-content {
    padding: 14px 16px;
    gap: 10px;
  }

  .option-desc {
    display: none;
  }

  .welcome-meta {
    flex-direction: column;
    gap: 12px;
    align-items: center;
  }

  .nav-buttons {
    flex-direction: column-reverse;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .logo {
    width: 180px;
  }

  .rpe-item {
    font-size: 0.8rem;
    padding: 8px 12px;
  }

  .rpe-num {
    min-width: 50px;
    font-size: 0.8rem;
  }
}

@media (min-width: 641px) {
  .checkbox-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}