/* Squat Score — task-based PHP/MySQL proof of concept */

:root {
  --navy: #123047;
  --teal: #12a6a0;
  --teal-dark: #0b837e;
  --bg: #f5fbfb;
  --panel: rgba(255, 255, 255, 0.94);
  --text: #17212b;
  --muted: #637684;
  --line: #dbe8e8;
  --shadow: 0 18px 45px rgba(18, 48, 71, 0.11);
  --radius: 22px;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: #eff3f2;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.28), rgba(245,251,251,0.52)),
    url("../img/subway-bg.svg") left top / 960px 540px repeat fixed;
}

button, input, select, textarea { font: inherit; }

.site-header, .app-shell, .site-footer {
  width: min(1120px, calc(100% - 28px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 8px 0 6px;
  background: linear-gradient(180deg, rgba(248,252,252,0.76), rgba(248,252,252,0.32));
  backdrop-filter: blur(5px);
}

.brand { display: block; width: fit-content; }

.brand img {
  display: block;
  width: min(440px, 82vw);
  height: auto;
  filter: drop-shadow(0 4px 14px rgba(18, 48, 71, 0.05));
}

.app-shell {
  display: grid;
  gap: 16px;
  padding: 12px 0 30px;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(219, 232, 232, 0.94);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  backdrop-filter: blur(3px);
}

.intro, .flow-card, .scoring-panel {
  padding: clamp(18px, 4vw, 34px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1, h2 {
  color: var(--navy);
  letter-spacing: -0.055em;
  line-height: 0.95;
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 8vw, 5rem);
}

h2 {
  margin: 0;
  font-size: clamp(1.6rem, 4.4vw, 2.5rem);
}

.intro-copy, #flowDescription, .muted, .status {
  color: var(--muted);
  line-height: 1.5;
}

.subtle {
  font-size: .9rem;
  margin-top: -8px;
}

.intro-copy {
  max-width: 58ch;
  font-size: 1.05rem;
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 22px;
}

.task-card {
  min-height: 180px;
  text-align: left;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,0.88);
  color: var(--text);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.task-card:hover {
  transform: translateY(-2px);
  border-color: rgba(18, 166, 160, 0.58);
  box-shadow: 0 16px 30px rgba(18, 48, 71, 0.11);
}

.task-card strong {
  color: var(--navy);
  font-size: 1.25rem;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.task-card span:not(.task-icon) {
  color: var(--muted);
  line-height: 1.35;
}

.task-icon {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(18, 166, 160, 0.13);
  color: var(--teal-dark);
  font-size: 1.45rem;
  font-weight: 900;
}

.hidden { display: none !important; }

.workflow { display: grid; gap: 16px; }

.flow-card { display: grid; gap: 16px; }

.flow-topline, .flow-actions, .details-actions, .dialog-actions, .dialog-header {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.flow-topline { justify-content: space-between; }

.text-btn {
  border: 0;
  background: transparent;
  color: var(--teal-dark);
  font-weight: 850;
  cursor: pointer;
  padding: 0;
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(18, 166, 160, 0.13);
  color: var(--teal-dark);
  font-weight: 900;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  font-weight: 850;
  transition: transform 140ms ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}

.btn-secondary {
  color: var(--navy);
  background: #fff;
  border-color: var(--line);
}

.full {
  width: 100%;
  margin-top: 12px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(310px, 0.75fr);
  gap: 16px;
  align-items: start;
}

.map-panel, .result-panel, .selected-panel { padding: 18px; }

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-heading h2 { font-size: 1.35rem; }

.section-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

#map {
  height: min(65vh, 620px);
  min-height: 430px;
  border-radius: 16px;
  border: 1px solid var(--line);
  overflow: hidden;
}

.side-panel {
  display: grid;
  gap: 16px;
}

.restroom-list {
  display: grid;
  gap: 10px;
}

.restroom-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 13px 14px;
  cursor: pointer;
}

.restroom-item:hover { border-color: rgba(18, 166, 160, 0.55); }

.restroom-item strong {
  display: block;
  color: var(--navy);
  font-size: 1.02rem;
}

.restroom-item span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 4px;
}

.score-pill {
  display: inline-flex !important;
  width: fit-content;
  align-items: center;
  color: var(--navy) !important;
  background: rgba(18, 166, 160, 0.12);
  border-radius: 999px;
  padding: 4px 9px;
  margin-top: 8px;
  font-weight: 900;
}

.score-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin: 14px 0;
}

.score-summary div {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: #fff;
}

.score-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.score-summary strong {
  display: block;
  margin-top: 5px;
  color: var(--navy);
  font-size: 1.55rem;
}

.score-meaning {
  margin: 8px 0 0;
  color: var(--teal-dark);
  font-weight: 850;
  line-height: 1.35;
}

.review-snippets {
  display: grid;
  gap: 10px;
}

.review-snippet {
  color: var(--muted);
  padding: 12px 14px;
  border-left: 4px solid var(--teal);
  background: #f8fcfc;
  border-radius: 12px;
}

.scoring-panel { padding: 16px 20px; }

.scoring-panel summary {
  cursor: pointer;
  color: var(--navy);
  font-weight: 900;
}

.score-guide-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.guide-item {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  border-radius: 16px;
  padding: 12px;
}

.guide-item strong {
  display: block;
  color: var(--navy);
  font-size: 1.05rem;
}

.guide-item span {
  display: block;
  color: var(--muted);
  margin-top: 5px;
  font-size: 0.88rem;
  line-height: 1.3;
}

.dialog {
  width: min(560px, calc(100% - 28px));
  border: 0;
  border-radius: 24px;
  padding: 0;
  box-shadow: 0 28px 80px rgba(13,34,51,0.3);
}

.dialog::backdrop {
  background: rgba(13,34,51,0.48);
  backdrop-filter: blur(4px);
}

.dialog form {
  padding: 22px;
  display: grid;
  gap: 16px;
}

.dialog-header, .dialog-actions { justify-content: space-between; }

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  font-size: 1.5rem;
  cursor: pointer;
}

label {
  display: grid;
  gap: 8px;
  color: var(--navy);
  font-weight: 800;
}

input[type="text"], select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 13px;
  color: var(--text);
  background: #fff;
}

textarea {
  min-height: 98px;
  resize: vertical;
}

.range-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 14px;
  align-items: center;
}

.range-row input {
  grid-column: 1 / -1;
  accent-color: var(--teal);
}

.range-row output {
  color: var(--teal-dark);
  font-weight: 950;
  font-size: 1.2rem;
}

.featured-range output { font-size: 1.6rem; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--teal);
}

.site-footer {
  padding: 0 0 28px;
  color: var(--muted);
  text-align: center;
}

.popup-select {
  margin-top: 6px;
  border: 0;
  border-radius: 999px;
  background: var(--teal);
  color: white;
  padding: 6px 10px;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 880px) {
  .task-grid, .workspace, .score-guide-grid { grid-template-columns: 1fr; }

  .task-card { min-height: auto; }

  #map {
    min-height: 360px;
    height: 52vh;
  }

  .flow-actions .btn { width: 100%; }

  .brand img { width: min(350px, 84vw); }
}
