:root {
  --color-mist: #c4dbe5;
  --color-stone: #3e6c98;
  --color-shadow: #17232d;
  --color-accent: #4a7db8;
  --color-accent-strong: #2d5390;
  --color-surface: rgba(23, 33, 42, 0.74);
  --color-surface-strong: rgba(54, 94, 133, 0.18);
  --color-border: rgba(144, 175, 197, 0.16);
  --color-text: #eef5fb;
  --color-text-muted: rgba(238, 245, 251, 0.74);
  --color-button: #4a7db8;
  --color-button-alt: #763626;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  width: 100%;
  padding: 0;
  background-image: url('https://live.staticflickr.com/8645/16189880796_745960832e_b.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #17232d;
  color: var(--color-text);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 10%, rgba(255,255,255,0.16), transparent 18%),
              linear-gradient(180deg, rgba(23, 33, 42, 0.7), transparent 45%);
  pointer-events: none;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  position: relative;
}

.page-card {
  width: min(100%, 520px);
  padding: 32px 28px;
  border-radius: 32px;
  background: rgba(40, 46, 52, 0.75);
  border: 1px solid rgba(144, 175, 197, 0.18);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.35);

}

h1 {
  margin: 0 0 10px;
  color: var(--color-text);
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: 0.05em;
  text-align: center;
  text-transform: uppercase;
}

.subtitle {
  margin: 0 0 26px;
  color: rgba(245, 245, 245, 0.78);
  text-align: center;
  line-height: 1.6;
  font-size: 1rem;
}

a,
button {
  color: var(--color-text);
  font-size: clamp(1rem, 3.5vw, 1.1rem);
  text-decoration: none;
  background: linear-gradient(135deg, rgba(74, 125, 184, 0.85), rgba(45, 83, 144, 0.7));
  padding: 16px 18px;
  border-radius: 18px;
  width: 100%;
  text-align: center;
  box-shadow: 0 18px 45px rgba(17, 43, 67, 0.22);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  font-weight: 700;
  opacity: 0.95;
  transition: background 0.25s ease, opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

a:hover,
button:hover {
  background: linear-gradient(135deg, rgba(74, 125, 184, 1), rgba(45, 83, 144, 0.92));
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 20px 50px rgba(17, 43, 67, 0.28);
}

form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(144, 175, 197, 0.08);
  border: 1px solid var(--color-border);
}

.row span {
  display: block;
  flex: 1;
  width: auto;
  background: transparent;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  color: var(--color-text);
}

.touch-field {
  display: inline-flex;
  align-items: center;
  min-width: 160px;
  max-width: 260px;
  border: 1px solid rgba(144, 175, 197, 0.18);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(51, 107, 135, 0.08);
}

.touch-field__button {
  all: unset;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  color: var(--color-text);
  cursor: pointer;
  user-select: none;
  background: rgba(51, 107, 135, 0.18);
  font-size: 1.5rem;
}

.touch-field__button:hover {
  background: rgba(90, 175, 197, 0.22);
}

.touch-field__input {
  width: 100%;
  min-width: 72px;
  border: none;
  padding: 12px 10px;
  text-align: center;
  background: transparent;
  color: #fff;
  font-size: 1rem;
}

.touch-field__input::-webkit-inner-spin-button,
.touch-field__input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.touch-field__input {
  -moz-appearance: textfield;
}

input,
textarea,
select {
  display: inline-flex;
  width: 110px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(144, 175, 197, 0.32);
  color: var(--color-text);
  background-color: #1f2b33;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--color-mist);
  border-color: var(--color-mist);
}

@media (max-width: 700px) {
  body {
    padding: 16px 12px 24px;
  }

  .page-card {
    padding: 16px;
  }

  .row {
    flex-direction: column;
    align-items: stretch;
  }

  .row span {
    margin-bottom: 6px;
  }

  input,
  textarea {
    width: 100%;
    margin-left: 0;
  }
}

/* Calendar styles for Analyse.php */
.back-button-wrap {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.back-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: auto;
  padding: 10px 16px;
  border-radius: 999px;
  background: conic-gradient(135deg, var(--color-autumn), var(--color-cta-alt));
  color: var(--color-text);
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(118, 54, 38, 0.32);
}

.back-link {
  display: inline-flex;
  width: auto;
  margin-bottom: 16px;
  padding: 10px 16px;
  border-radius: 999px;
  background: conic-gradient(135deg, var(--color-autumn), var(--color-cta-alt));
  color: var(--color-text);
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(118, 54, 38, 0.32);
}

.checkbox-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.checkbox-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(144, 175, 197, 0.08);
  border: 1px solid rgba(144, 175, 197, 0.24);
  color: var(--color-text);
}

.checkbox-card input[type="checkbox"] {
  width: auto;
  accent-color: var(--color-mist);
}

.form-actions {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.form-actions button {
  width: auto;
  min-width: 180px;
}

.analysis-section {
  margin-top: 16px;
}
.analysis-section:first-of-type {
  margin-top: 0;
}
.analysis-row {
  justify-content: space-between;
  gap: 12px;
}
.analysis-row label {
  color: #f5f5f5;
  font-weight: 600;
}
.analysis-select {
  width: min(100%, 220px);
  min-width: 0;
}
.analysis-chart-card {
  margin-top: 16px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(51, 107, 135, 0.12);
  border: 1px solid rgba(144, 175, 197, 0.24);
}
.calendar {
  width: 100%;
  display: flex;
  justify-content: center;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 40px);
  gap: 6px;
  justify-content: center;
}
.calendar-head {
  font-size: 0.75rem;
  text-align: center;
  color: #d0d0d0;
}
.calendar-cell {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.calendar-cell.empty { background: transparent; border: none; }
.calendar-cell.day.has-entry.is-a { background: var(--color-autumn); border-color: var(--color-autumn); }
.calendar-cell.day.has-entry.is-b { background: var(--color-stone); border-color: var(--color-stone); }
.calendar-cell.day.has-entry.is-other { background: var(--color-shadow); border-color: var(--color-shadow); }
.calendar-cell.day.has-entry.is-a-other::before,
.calendar-cell.day.has-entry.is-a-b::before,
.calendar-cell.day.has-entry.is-b-other::before {
  content: '';
  position: absolute;
  inset: 0;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}
.calendar-cell.day.has-entry.is-a-other::after,
.calendar-cell.day.has-entry.is-a-b::after,
.calendar-cell.day.has-entry.is-b-other::after {
  content: '';
  position: absolute;
  inset: 0;
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}
.calendar-cell.day.has-entry.is-a-other { background: var(--color-autumn); border-color: var(--color-autumn); }
.calendar-cell.day.has-entry.is-a-other::after { background: var(--color-shadow); }
.calendar-cell.day.has-entry.is-a-b { background: var(--color-autumn); border-color: var(--color-autumn); }
.calendar-cell.day.has-entry.is-a-b::after { background: var(--color-stone); }
.calendar-cell.day.has-entry.is-b-other { background: var(--color-stone); border-color: var(--color-stone); }
.calendar-cell.day.has-entry.is-b-other::after { background: var(--color-shadow); }

@media (max-width: 700px) {
  .analysis-row {
    flex-direction: column;
    align-items: stretch;
  }

  .analysis-select {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .calendar-grid { grid-template-columns: repeat(7, 36px); gap: 4px; }
  .calendar-cell { width:36px; height:36px; }
}