﻿:root {
  --bg-1: #f2fbff;
  --bg-2: #fff9ed;
  --ink: #13233a;
  --muted: #4f6379;
  --panel: rgba(255, 255, 255, 0.84);
  --line: #d3dfef;
  --brand: #0f9f8b;
  --brand-2: #1f6aff;
  --sun: #ff9f43;
  --danger: #c5392f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  background:
    radial-gradient(circle at 20% -10%, #b8ffed 0%, transparent 28%),
    radial-gradient(circle at 110% 10%, #ffd8a8 0%, transparent 32%),
    linear-gradient(120deg, var(--bg-1), var(--bg-2));
  min-height: 100vh;
}

.app-shell {
  width: min(1120px, 94vw);
  margin: 1.2rem auto 2.2rem;
  display: grid;
  gap: 1rem;
}

.card {
  backdrop-filter: blur(6px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem;
  box-shadow: 0 12px 26px rgba(19, 35, 58, 0.08);
  animation: rise 320ms ease;
}

.auth-center {
  max-width: 460px;
  margin: 0 auto;
}

.hero {
  background: linear-gradient(140deg, rgba(31, 106, 255, 0.12), rgba(15, 159, 139, 0.16));
}

h1, h2 { margin: 0 0 0.55rem; }
h1 { font-size: clamp(1.5rem, 4vw, 2.2rem); }
h3 { margin: 0; }

p { margin: 0; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

.protocol-warn {
  margin: 0.8rem auto 0;
  width: min(1120px, 94vw);
  background: #ffe9e7;
  color: #7a1b17;
  border: 1px solid #f5c0bb;
  border-radius: 12px;
  padding: 0.7rem;
}

.grid {
  display: grid;
  gap: 0.8rem;
}

.cols-3 {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.cols-2 {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.auth-switch {
  margin-top: 0.8rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.auth-switch button {
  padding: 0.58rem 0.72rem;
  border: 1px solid var(--line);
  background: #eef4ff;
  color: #204065;
}

.auth-switch button.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(130deg, var(--brand), var(--brand-2));
}

.auth-form {
  margin-top: 0.75rem;
}

label {
  display: grid;
  gap: 0.32rem;
  font-size: 0.91rem;
  color: var(--muted);
}

input, select, button {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 0.65rem 0.72rem;
  font-size: 0.95rem;
}

input, select {
  background: #fff;
}

button {
  border: none;
  color: #fff;
  background: linear-gradient(130deg, var(--brand), var(--brand-2));
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}

button:hover { transform: translateY(-1px); filter: brightness(1.05); }
button:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
button.alt { background: linear-gradient(130deg, #0c7e71, #2663d8); }

.actions { display: flex; align-items: end; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.status {
  color: var(--muted);
  min-height: 1.2rem;
  font-size: 0.92rem;
}
.status.error { color: var(--danger); }

.stats-grid {
  margin-top: 0.5rem;
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.stat {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  padding: 0.7rem;
}

.stat h3 {
  margin: 0 0 0.2rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.big {
  font-weight: 800;
  font-size: 1.02rem;
}

.progress {
  height: 8px;
  margin-top: 0.45rem;
  border-radius: 999px;
  background: #e8eef9;
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--sun));
}

.water-row {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: 1.3fr 1fr 1fr;
}

.inline {
  display: grid;
  align-items: center;
}

.chip {
  background: #e8fff6;
  color: #0f7d5f;
  border: 1px solid #bbf0dd;
  border-radius: 999px;
  padding: 0.32rem 0.62rem;
  font-weight: 700;
  font-size: 0.87rem;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 0.56rem 0.2rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.92rem;
}
th { color: var(--muted); }

.goals-form {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--line);
}

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

@media (max-width: 760px) {
  .water-row { grid-template-columns: 1fr; }
}
