/* R-34 — Minimalistisch, veel witruimte */
/* R-35 — Neutraal kleurpalet, één accentkleur */
/* R-36 — Geen gamification-elementen */

:root {
  --bg: #faf9f7;
  --surface: #f2f0ec;
  --text: #2c2c2c;
  --muted: #888;
  --accent: #7b7260;
  --accent-light: #e8e4dc;
  --radius: 12px;
  --font: "Georgia", serif;
}

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

html, body {
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
}

/* --- Laad-indicator --- */

#loading {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  animation: slide 1s infinite ease-in-out;
  z-index: 100;
}

@keyframes slide {
  0%   { transform: scaleX(0); transform-origin: left; }
  50%  { transform: scaleX(1); transform-origin: left; }
  51%  { transform: scaleX(1); transform-origin: right; }
  100% { transform: scaleX(0); transform-origin: right; }
}

/* --- Schermen --- */

.screen {
  display: none;
  flex: 1;
  padding: 2rem 1.5rem;
  flex-direction: column;
}

.screen.active {
  display: flex;
}

/* --- Selectiescherm --- */

#screen-select {
  justify-content: center;
  gap: 2rem;
}

#screen-select h1 {
  font-size: 1.6rem;
  font-weight: normal;
  text-align: center;
  letter-spacing: 0.04em;
}

#screen-select p {
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

#user-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.name-btn {
  background: var(--surface);
  border: none;
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.name-btn:hover, .name-btn:focus {
  background: var(--accent-light);
  outline: none;
}

/* --- Navigatiebalk --- */

nav {
  display: flex;
  border-top: 1px solid var(--surface);
  background: var(--bg);
}

nav button {
  flex: 1;
  background: none;
  border: none;
  padding: 1rem 0.5rem 1.25rem;
  font-family: var(--font);
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: color 0.15s;
}

nav button.active,
nav button:hover {
  color: var(--accent);
}

/* --- Hoofdscherm --- */

#screen-home {
  gap: 1.75rem;
}

#greeting {
  font-size: 1.4rem;
  font-weight: normal;
  letter-spacing: 0.02em;
}

#anchor-reminder {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

.checkin-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 0;
}

#checkin-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: 1.1rem 2.5rem;
  font-family: var(--font);
  font-size: 1.05rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

#checkin-btn:hover:not(:disabled) {
  background: #635c4d;
}

#checkin-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

#checkin-confirm {
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
  animation: fadein 0.5s ease;
}

@keyframes fadein {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

#milestone {
  font-size: 0.9rem;
  color: var(--accent);
  text-align: center;
  font-style: italic;
}

.home-stats {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#week-count {
  font-size: 0.85rem;
  color: var(--muted);
}

#lapse-message {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

/* --- Groepsscherm --- */

#screen-group {
  gap: 1.75rem;
}

#screen-group h2 {
  font-size: 1.2rem;
  font-weight: normal;
}

#group-session-info {
  color: var(--muted);
  font-size: 0.95rem;
}

#group-btn-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#group-checkin-btn {
  background: var(--surface);
  border: 1px solid var(--accent-light);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
}

#group-checkin-btn:hover:not(:disabled) {
  background: var(--accent-light);
}

#group-checkin-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

#group-confirm {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

#group-outside-window {
  font-size: 0.85rem;
  color: var(--muted);
}

/* --- Instellingenscherm --- */

#screen-settings {
  gap: 1.75rem;
}

#screen-settings h2 {
  font-size: 1.2rem;
  font-weight: normal;
}

#settings-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field label {
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.field input,
.field textarea {
  background: var(--surface);
  border: none;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--text);
  width: 100%;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: 2px solid var(--accent-light);
}

.field small {
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
}

.save-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: 0.85rem 2rem;
  font-family: var(--font);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s;
  align-self: flex-start;
}

.save-btn:hover {
  background: #635c4d;
}

#settings-saved {
  font-size: 0.85rem;
  color: var(--muted);
}

.push-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.push-section p {
  font-size: 0.85rem;
  color: var(--muted);
}

#push-permission-btn {
  background: var(--surface);
  border: 1px solid var(--accent-light);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
}

#push-permission-btn:hover:not(:disabled) {
  background: var(--accent-light);
}

#push-permission-btn:disabled {
  opacity: 0.6;
  cursor: default;
}
