/* ==================================
   DARK MODE SUPPORT
================================== */

:root {
  --bg-main: #f4f6f8;
  --bg-card: #ffffff;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --border-subtle: #e5e7eb;
  --accent: #0f766e;
  --accent-hover: #115e59;
  --focus-ring: rgba(15, 118, 110, 0.3);
}

/* Dark theme variables */
body.dark-mode {
  --bg-main: #0f172a;
  --bg-card: #1e293b;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --border-subtle: #334155;
  --accent: #14b8a6;
  --accent-hover: #0d9488;
  --focus-ring: rgba(20, 184, 166, 0.4);
}

/* Toggle switch styles */
.theme-toggle-container {
  display: flex;
  justify-content: flex-end;
  max-width: 640px;
  margin: 2rem auto 0 auto;
}

.theme-toggle {
  position: relative;
  width: 50px;
  height: 26px;
}

.theme-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #ccc;
  border-radius: 50px;
  transition: 0.3s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}

.theme-toggle input:checked + .slider {
  background-color: var(--accent);
}

.theme-toggle input:checked + .slider:before {
  transform: translateX(24px);
}
/* =========================================
   GLOBAL
========================================= */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  transition: background 0.3s ease, color 0.3s ease;
}



/* =========================================
   CONTAINER
========================================= */

main {
  padding: 20px;
}

#survey-form {
  max-width: 640px;
  margin: 40px auto;
  padding: 30px;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  transition: background 0.3s ease, border 0.3s ease;
}

h2 {
  margin-top: 0;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
}

p {
  text-align: center;
  color: var(--text-muted);
  font-size: 16px;
  margin-top: 8px;
}

/* =========================================
   FORM ELEMENTS
========================================= */

.form-group {
  margin-bottom: 18px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-main);
  color: var(--text-main);
  font-size: 14px;
  transition: all 0.2s ease;
}

textarea {
  resize: vertical;
  min-height: 90px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--focus-ring);
  background: var(--bg-card);
}

/* Radio group */
.radio-group label {
  display: inline-flex;
  align-items: center;
  margin-right: 15px;
  font-weight: 400;
}

.radio-group input {
  margin-right: 5px;
  width: auto;
}

/* =========================================
   BUTTON
========================================= */

button {
  margin-top: 15px;
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: white;
  transition: background 0.2s ease, transform 0.1s ease;
}

button:hover {
  background: var(--accent-hover);
}

button:active {
  transform: scale(0.98);
}

.submit-btn{
  width:100%;
  padding:14px;
  border:none;
  border-radius:8px;
  background:#0f766e;
  color:white;
  font-size:16px;
  font-weight:600;
  cursor:pointer;
  transition:all .3s ease;
}

.submit-btn:hover{
  background:#115e59;
  transform:translateY(-2px);
}

/* =========================================
   VALIDATION
========================================= */

input.error,
select.error,
textarea.error {
  border-color: #dc2626;
  background-color: #fef2f2;
}

input.success,
select.success,
textarea.success {
  border-color: #16a34a;
  background-color: #f0fdf4;
}

.error-message {
  color: #dc2626;
  font-size: 12px;
  margin-top: 4px;
  min-height: 14px;
}

.success-message {
  color: #16a34a;
  font-size: 12px;
  margin-top: 4px;
  min-height: 14px;
}

/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 600px) {
  #survey-form {
    padding: 20px;
    margin: 20px;
  }
}
