@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
:root {
  --bg: #f3f3f3;
  --line: #cfcfcf;
  --line2: #d8d8d8;
  --text: #333;
  --head: #2f2f2f;
  --blue: #b9c7d6;
  --blue-fill: #dbe6f0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #fff;
  font-family: "Inter", sans-serif;
  color: var(--text);
}

.title {
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  margin: 0 0 18px;
  letter-spacing: 0.2px;
  color: var(--head);
}

.top-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px 28px;
  margin-bottom: 18px;
}

.field label,
.section-label {
  display: block;
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 8px;
  color: #000;
}

input[type="text"],
input[type="number"],
input[type="email"],
textarea {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line2);
  padding: 1px 10px;
  font-size: 16px;
  color: var(--text);
  outline: none;
}

textarea {
  height: 170px;
  resize: none;
  padding: 15px;
}

input::placeholder,
textarea::placeholder {
  color: #b0b0b0;
}

.gender-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 48px;
}

.check-inline {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #4a4a4a;
  cursor: pointer;
}

.check-inline input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #b8c7d6;
}

label.check-inline input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border: 1px solid var(--blue);
  margin: 0;
  cursor: pointer;
  border-radius: 0;
}

label.check-inline input[type="radio"]:checked {
  background: #adb8c3;
  box-shadow: inset 0 0 0 4px #f8f8f8;
  border-color: #9fb1c3;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #f5f0f4;
}

.questionnaire {
  border: 2px solid var(--line);
  margin-top: 16px;
  background-color: #f5f0f4;
}

.questionnaire td,
.questionnaire th {
  border: 2px solid var(--line);
  vertical-align: middle;
  padding: 17px 14px;
  font-size: 14px;
}

.questionnaire .num {
  width: 42px;
  text-align: center;
  font-size: 16px;
  color: #000;
  padding: 10px 6px;
}

.questionnaire .q {
  line-height: 1.65;
  font-size: 20px;
  color: black;
}

.questionnaire .yn {
  width: 120px;
  text-align: center;
  padding: 8px 4px;
}

.yn-wrap {
  display: flex;
  justify-content: center;
  gap: 12px;
  align-items: flex-start;
}

.yn-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #434242;
  text-transform: none;
  cursor: pointer;
}

.square-radio {
  appearance: none;
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  border: 1px solid var(--blue);
  background: #f8f8f8;
  margin: 0;
  cursor: pointer;
  border-radius: 0;
}

.square-radio:checked {
  background: #adb8c3;
  box-shadow: inset 0 0 0 4px #f8f8f8;
  border-color: #9fb1c3;
}

.line-input {
  display: inline-block;
  vertical-align: middle;
  width: 110px;
  height: 18px;
  border: none;
  border-bottom: 1px solid #666;
  background: transparent;
  padding: 0 2px;
  font-size: 14px;
  color: var(--text);
  margin: 0 3px;
  outline: none;
  border-radius: 0;
}

.line-input.sm {
  width: 58px;
}

.line-input.md {
  width: 72px;
}

.line-input.lg {
  width: 120px;
}

.sleepiness {
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-top: -1px;
}

.sleepiness th,
.sleepiness td {
  border: 1px solid var(--line);
  padding: 16px 12px;
  font-size: 14px;
}

.sleepiness thead th {
  background: #e9e2ea;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

table.sleepiness tr td:nth-child(even) {
  background: #fff;
}

.sleepiness .situation {
  width: 64%;
  text-align: left;
  padding-left: 28px;
  font-size: 20px;
  color: black;
}

.chance-cell {
  width: 9%;
  text-align: center;
  padding: 0 !important;
}

.chance-option {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 62px;
  width: 100%;
  cursor: pointer;
  font-size: 20px;
  font-weight: 700;
  color: #444;
  user-select: none;
  transition: background 0.15s ease, color 0.15s ease;
  position: relative;
}

.chance-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chance-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 62px;
}

.chance-option input:checked + span {
  background: var(--blue-fill);
  color: #222;
}

.bottom {
  margin-top: 54px;
}

.bottom .box {
  margin-bottom: 28px;
}

.actions {
  margin-top: 26px;
  display: flex;
  justify-content: flex-end;
}

.submit-btn {
    width: 100%;
    height: 50px;
    border: 1px solid #c5c5c5;
    background: #5c225f;
    color: #ffffff;
    font-family: "Inter", sans-serif;
    font-size: 18px;
    letter-spacing: 1px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 2px;
    margin: auto;
    margin-bottom: 42px;
}

.submit-btn:hover {
    background: #0b0b0b;
    border-color: black;
}

table.questionnaire input[type="text"] {
  border: none;
  border-bottom: 1px solid;
  height: 23px;
  margin-top: -9px;
  background: transparent;
  border-radius: 0px !important;
}

.custom-form-success {
  background: #eafaf1;
  border: 1px solid #28a745;
  color: #155724;
  padding: 14px 18px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.5;
  margin-top: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeInUp 0.4s ease;
}

/* Optional icon */
.custom-form-success::before {
  content: "✔";
  font-size: 16px;
  color: #28a745;
  font-weight: bold;
}

/* Smooth entry animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .page {
    max-width: calc(100vw - 20px);
  }

  .top-grid {
    grid-template-columns: 1fr;
  }

  .questionnaire,
  .sleepiness {
    display: block;
    overflow-x: auto;
  }

  .chance-option {
    font-size: 16px;
  }

  .questionnaire .q {
    font-size: 14px;
  }

  .actions {
    justify-content: flex-start;
  }
}

@media screen and (max-width: 767px) {
  .sleepiness th,
  .sleepiness td {
    padding: 2px 12px;
    font-size: 15px !important;
  }
}


