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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f4f6f9;
  color: #2d3748;
  min-height: 100vh;
  padding: 2rem 1rem;
}

.container {
  max-width: 780px;
  margin: 0 auto;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a365d;
}

header p {
  margin-top: 0.5rem;
  color: #718096;
  font-size: 0.95rem;
}

.time-notice {
  text-align: center;
  color: #4a5568;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.scale-legend {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #2b6cb0 0%, #3182ce 100%);
  border-radius: 10px;
  padding: 1rem 1.5rem;
  margin-bottom: 1.75rem;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(49, 130, 206, 0.35);
}

.scale-legend .legend-low {
  font-size: 0.85rem;
  font-weight: 600;
  text-align: left;
}

.scale-legend .legend-sep {
  display: flex;
  gap: 4px;
  justify-content: center;
  align-items: center;
}

.scale-legend .legend-sep span {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
}

.scale-legend .legend-sep span:nth-child(3) {
  background: rgba(255, 255, 255, 0.9);
  width: 8px;
  height: 8px;
}

.scale-legend .legend-high {
  font-size: 0.85rem;
  font-weight: 600;
  text-align: right;
}

@media (max-width: 480px) {
  .scale-legend {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    text-align: center;
    gap: 0.4rem;
    padding: 0.9rem 1rem;
  }

  .scale-legend .legend-low,
  .scale-legend .legend-high {
    text-align: center;
    font-size: 0.8rem;
  }

  .scale-legend .legend-sep {
    order: -1;
  }
}

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.clinic-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.975rem;
  background: #f7faff;
  color: #2d3748;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234a5568' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.clinic-select:focus {
  outline: none;
  border-color: #3182ce;
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}

.clinic-select:disabled {
  background-color: #f0f4f8;
  color: #718096;
  cursor: default;
  border-color: #e2e8f0;
}

.question-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  transition: box-shadow 0.15s ease;
}

.question-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

.question-text {
  font-size: 0.975rem;
  font-weight: 500;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.radio-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.radio-option {
  flex: 1;
  min-width: 52px;
}

.radio-option input[type="radio"] {
  display: none;
}

.radio-option label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.5rem 0.25rem;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  color: #4a5568;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  user-select: none;
  text-align: center;
}

.radio-option label .hint {
  font-size: 0.6rem;
  font-weight: 400;
  color: #a0aec0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.radio-option input[type="radio"]:checked + label {
  border-color: #3182ce;
  background: #ebf8ff;
  color: #2b6cb0;
}

.radio-option input[type="radio"]:checked + label .hint {
  color: #63b3ed;
}

.radio-option label:hover {
  border-color: #90cdf4;
  background: #f7faff;
}

.actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

button {
  padding: 0.65rem 1.5rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, transform 0.1s;
}

button:active {
  transform: scale(0.97);
}

.btn-reset {
  background: #edf2f7;
  color: #4a5568;
}

.btn-reset:hover {
  background: #e2e8f0;
}

.btn-submit {
  background: #3182ce;
  color: #ffffff;
}

.btn-submit:hover {
  background: #2b6cb0;
}

.result-banner {
  display: none;
  margin-top: 1.5rem;
  padding: 1rem 1.5rem;
  background: #c6f6d5;
  border: 1px solid #9ae6b4;
  border-radius: 10px;
  color: #22543d;
  font-weight: 600;
  text-align: center;
}

.error-banner {
  display: none;
  margin-top: 1.5rem;
  padding: 1rem 1.5rem;
  background: #fed7d7;
  border: 1px solid #feb2b2;
  border-radius: 10px;
  color: #742a2a;
  font-weight: 600;
  text-align: center;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.field-group:last-child {
  margin-bottom: 0;
}

.field-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #4a5568;
}

.field-group input[type="text"],
.field-group input[type="email"] {
  padding: 0.55rem 0.85rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.95rem;
  color: #2d3748;
  transition: border-color 0.15s;
  outline: none;
}

.field-group input[type="text"]:focus,
.field-group input[type="email"]:focus {
  border-color: #3182ce;
}

.field-hint {
  font-size: 0.8rem;
  color: #718096;
}

.final-question-card {
  background: #ffffff;
  border: 2px solid #3182ce;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 2px 10px rgba(49, 130, 206, 0.15);
}

.final-question-card .question-text {
  color: #1a365d;
  font-weight: 600;
}

.logout-btn {
  position: fixed;
  top: 1rem;
  right: 1rem;
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  background: transparent;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  color: #718096;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  z-index: 100;
}

.logout-btn:hover {
  background: #fed7d7;
  border-color: #feb2b2;
  color: #742a2a;
}

