/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: #2d3748;
}

a { color: #667eea; text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }

/* ── Auth layout (login, register, forgot-password) ──────── */
.auth-body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  background: white;
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}

.logo { text-align: center; margin-bottom: 32px; }
.logo h1 { font-size: 1.7rem; color: #2d3748; font-weight: 800; }
.logo p  { color: #a0aec0; font-size: .9rem; margin-top: 4px; }

/* ── Alerts ───────────────────────────────────────────────── */
.alert {
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .88rem;
  margin-bottom: 16px;
}
.alert-error   { background: #fff5f5; color: #e53e3e; border: 1px solid #fed7d7; }
.alert-success { background: #f0fff4; color: #38a169; border: 1px solid #c6f6d5; }

/* ── Form elements ────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: .93rem;
  font-family: inherit;
  color: #2d3748;
  background: #fafafa;
  transition: border-color .2s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #667eea;
  background: white;
}
textarea { resize: vertical; min-height: 78px; }
select   { cursor: pointer; }

.hint {
  font-size: .78rem;
  color: #a0aec0;
  margin-top: 4px;
  display: block;
}

.section-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #a0aec0;
  margin: 20px 0 12px;
}

.divider { border: none; border-top: 1px solid #e2e8f0; margin: 20px 0; }

.auth-links {
  text-align: center;
  margin-top: 18px;
  font-size: .88rem;
  color: #718096;
}

/* ── Password strength ────────────────────────────────────── */
.pw-strength     { height: 4px; border-radius: 2px; margin-top: 6px; background: #e2e8f0; overflow: hidden; }
.pw-strength-bar { height: 100%; border-radius: 2px; transition: all .3s; width: 0; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  font-size: .97rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all .2s;
  text-align: center;
}
.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  margin-top: 6px;
}
.btn-primary:hover { opacity: .9; transform: translateY(-1px); color: white; text-decoration: none; }

.btn-secondary {
  background: #edf2f7;
  color: #4a5568;
  padding: 9px 18px;
  font-size: .87rem;
  margin-top: 8px;
  width: 100%;
}
.btn-secondary:hover { background: #e2e8f0; color: #4a5568; text-decoration: none; }

/* ── Security question box ────────────────────────────────── */
.security-q-box {
  background: #f7f8ff;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: .9rem;
  color: #4a5568;
  margin-bottom: 4px;
}

/* ── Step indicator ───────────────────────────────────────── */
.step-indicator { display: flex; gap: 8px; margin-bottom: 24px; }
.step-dot       { height: 4px; flex: 1; border-radius: 2px; background: #e2e8f0; transition: background .3s; }
.step-dot.done  { background: #667eea; }

/* ── App layout ───────────────────────────────────────────── */
.app-body { background: #f0f4f8; min-height: 100vh; }

header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
}
header h1 { font-size: 1.3rem; font-weight: 800; }
.user-info { display: flex; align-items: center; gap: 14px; }
.user-info .username { font-size: .88rem; opacity: .85; }

.btn-logout {
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.3);
  color: white;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
  text-decoration: none;
  display: inline-block;
}
.btn-logout:hover { background: rgba(255,255,255,.3); color: white; text-decoration: none; }

/* ── Tabs ─────────────────────────────────────────────────── */
.tabs {
  display: flex;
  background: white;
  border-bottom: 2px solid #e2e8f0;
  padding: 0 28px;
}
.tab {
  padding: 14px 22px;
  cursor: pointer;
  font-weight: 600;
  color: #718096;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all .2s;
  user-select: none;
  font-size: .93rem;
}
.tab:hover  { color: #667eea; }
.tab.active { color: #667eea; border-bottom-color: #667eea; }

/* ── Container & pages ────────────────────────────────────── */
.container { max-width: 860px; margin: 0 auto; padding: 28px 18px; }
.page        { display: none; }
.page.active { display: block; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: white;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 1px 6px rgba(0,0,0,.07);
  margin-bottom: 18px;
}
.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #4a5568;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0f4f8;
}

/* ── G-blokken ────────────────────────────────────────────── */
.date-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 22px; }

.g-block  { margin-bottom: 22px; }
.g-label  { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.g-badge  {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .82rem; color: white; flex-shrink: 0;
}
.g-label-text strong { display: block; font-size: .93rem; }
.g-label-text span   { font-size: .76rem; color: #a0aec0; }

/* ── Gevoelens sliders ────────────────────────────────────── */
.gevoelens-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
  margin-bottom: 12px;
}
.gevoel-row   { display: flex; align-items: center; gap: 9px; }
.gevoel-naam  { min-width: 100px; font-size: .88rem; color: #4a5568; font-weight: 500; }
.gevoel-val   { min-width: 28px; text-align: right; font-size: .82rem; font-weight: 700; color: #a0aec0; }
.gevoel-val.active { color: #667eea; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: #e2e8f0;
  outline: none;
  cursor: pointer;
  border: none;
  padding: 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #667eea;
  cursor: pointer;
  transition: background .2s;
}
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #667eea;
  cursor: pointer;
  border: none;
}

/* ── App form buttons ─────────────────────────────────────── */
.btn-app-primary {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  padding: 13px 28px;
  border-radius: 10px;
  font-size: .97rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: all .2s;
  font-family: inherit;
}
.btn-app-primary:hover { opacity: .9; transform: translateY(-1px); }

.btn-app-secondary {
  background: #edf2f7;
  color: #4a5568;
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: .87rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  display: inline-block;
  transition: background .2s;
}
.btn-app-secondary:hover { background: #e2e8f0; color: #4a5568; text-decoration: none; }

/* ── Geschiedenis ─────────────────────────────────────────── */
.export-bar {
  background: white;
  border-radius: 12px;
  padding: 13px 18px;
  margin-bottom: 16px;
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.export-bar .label { color: #718096; font-size: .83rem; flex: 1; }

.history-top { display: flex; gap: 10px; margin-bottom: 14px; }
.history-top input { flex: 1; }

.entry-card {
  background: white;
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  border-left: 4px solid #667eea;
  transition: box-shadow .2s;
}
.entry-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }

.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}
.entry-date { font-weight: 700; color: #667eea; font-size: .88rem; }
.entry-time { color: #a0aec0; font-size: .78rem; margin-top: 2px; }

.entry-delete {
  background: none;
  border: none;
  color: #cbd5e0;
  cursor: pointer;
  font-size: 1rem;
  padding: 3px 7px;
  border-radius: 6px;
  transition: all .2s;
}
.entry-delete:hover { color: #e53e3e; background: #fff5f5; }

.entry-g { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; align-items: baseline; }
.entry-g-label { font-weight: 700; font-size: .73rem; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.entry-g-value { font-size: .88rem; color: #4a5568; line-height: 1.5; }

.gevoel-tag {
  display: inline-block;
  background: #f7f8ff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 2px 9px;
  font-size: .78rem;
  color: #4a5568;
  margin: 2px;
  font-weight: 500;
}
.gevoel-tag.hoog   { background: #fff5f5; border-color: #fed7d7; color: #c53030; }
.gevoel-tag.midden { background: #fffaf0; border-color: #fbd38d; color: #c05621; }
.gevoel-tag.laag   { background: #f0fff4; border-color: #c6f6d5; color: #276749; }

.empty-state { text-align: center; padding: 54px 20px; color: #a0aec0; }
.empty-state .icon { font-size: 2.5rem; margin-bottom: 10px; }

/* ── Stats ────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card { background: white; border-radius: 12px; padding: 18px; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.stat-number { font-size: 2rem; font-weight: 800; color: #667eea; }
.stat-label  { font-size: .78rem; color: #a0aec0; margin-top: 4px; }

.bar-row   { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.bar-name  { min-width: 110px; font-size: .83rem; color: #4a5568; }
.bar-track { flex: 1; background: #f0f4f8; border-radius: 4px; overflow: hidden; }
.bar-fill  { height: 18px; border-radius: 4px; background: linear-gradient(90deg, #667eea, #764ba2); }
.bar-count { font-size: .78rem; color: #a0aec0; min-width: 52px; text-align: right; }

/* ── Cookie banner ────────────────────────────────────────── */
#cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: white;
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -2px 16px rgba(0,0,0,.1);
  padding: 14px 20px;
  z-index: 9999;
}
#cookie-banner .inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
#cookie-banner p { flex: 1; min-width: 200px; font-size: .85rem; color: #4a5568; line-height: 1.5; }
#cookie-banner button {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  padding: 9px 22px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-size: .9rem;
  white-space: nowrap;
  font-family: inherit;
}

/* ── Nav dropdown ─────────────────────────────────────────── */
.user-dropdown { position: relative; }
.user-menu-btn {
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.3);
  color: white;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  transition: background .2s;
}
.user-menu-btn:hover { background: rgba(255,255,255,.3); }

.user-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: white;
  border-radius: 12px;
  padding: 6px;
  min-width: 210px;
  box-shadow: 0 10px 40px rgba(0,0,0,.18);
  z-index: 1000;
}
.user-menu.open { display: block; }
.user-menu a {
  display: block;
  padding: 10px 14px;
  color: #4a5568;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s;
}
.user-menu a:hover { background: #f7f8ff; text-decoration: none; color: #4a5568; }
.user-menu a.user-menu-danger       { color: #e53e3e; }
.user-menu a.user-menu-danger:hover { background: #fff5f5; }
.user-menu-divider { border: none; border-top: 1px solid #e2e8f0; margin: 4px 0; }

/* ── Demo banner ──────────────────────────────────────────── */
.demo-banner {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #78350f;
  padding: 11px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: .87rem;
  font-weight: 500;
}
.demo-banner a { color: #78350f; font-weight: 700; }

/* ── Demo login knop ──────────────────────────────────────── */
.demo-login-wrap {
  text-align: center;
  margin-top: 20px;
}
.demo-login-or {
  display: block;
  color: #a0aec0;
  font-size: .82rem;
  margin-bottom: 10px;
}
.btn-demo {
  display: inline-block;
  background: linear-gradient(135deg, #f093fb, #f5576c);
  color: white;
  padding: 11px 28px;
  border-radius: 10px;
  font-size: .95rem;
  font-weight: 700;
  text-decoration: none;
  transition: opacity .2s, transform .2s;
}
.btn-demo:hover { opacity: .9; transform: translateY(-1px); color: white; text-decoration: none; }
.demo-login-hint { color: #a0aec0; font-size: .78rem; margin-top: 8px; }

/* ── 2FA / TOTP stijlen ───────────────────────────────────── */
.totp-prompt {
  background: #f7f8ff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 18px;
  font-size: .88rem;
  color: #4a5568;
}
.totp-setup-box {
  background: #f7f8ff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px;
}
.totp-setup-label { font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: #a0aec0; margin-bottom: 4px; margin-top: 0; }
.totp-secret-code {
  font-family: 'Courier New', monospace;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: .15em;
  color: #667eea;
  word-break: break-all;
  background: white;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}
.totp-qr-hint { font-size: .78rem; color: #718096; margin-top: 12px; }
.totp-qr-hint a { color: #667eea; }

/* ── Account instellingen ─────────────────────────────────── */
.settings-card {
  background: white;
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: 0 1px 6px rgba(0,0,0,.07);
}
.settings-card-header {
  font-size: 1rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 2px solid #f0f4f8;
  display: flex;
  align-items: center;
  gap: 12px;
}
.badge-2fa {
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: .03em;
}
.badge-2fa.on  { background: #c6f6d5; color: #276749; }
.badge-2fa.off { background: #e2e8f0; color: #718096; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .gevoelens-grid   { grid-template-columns: 1fr; }
  .gevoel-naam      { min-width: 85px; }
  .date-row         { grid-template-columns: 1fr; }
  .tabs             { padding: 0 12px; }
  .tab              { padding: 11px 12px; font-size: .82rem; }
  .container        { padding: 18px 12px; }
  .auth-card        { padding: 28px 20px; }
}
