/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Share Tech Mono', 'Courier New', monospace;
  background: #0c0c0c;
  color: #b8b8a8;
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  letter-spacing: 0.5px;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

h1, h2, h3, h4 {
  font-family: 'Oswald', 'Arial Narrow', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
}

/* ===== APP SHELL ===== */
#root {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
}

/* ===== LOGIN ===== */
.login-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: #141414;
  border: 2px solid #2a2a22;
  padding: 48px 32px;
  width: 100%;
  text-align: center;
}
.login-logo {
  width: 56px; height: 56px;
  background: #3d4a2e;
  border: 2px solid #5a6b3f;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Oswald', sans-serif;
  font-weight: 700; font-size: 20px; color: #d4d4a8;
  letter-spacing: 2px;
  margin-bottom: 20px;
}
.login-card h1 {
  font-size: 24px; color: #d4d4a8; margin-bottom: 6px;
}
.login-subtitle {
  color: #555; font-size: 11px; margin-bottom: 28px;
  text-transform: uppercase; letter-spacing: 2px;
}
.login-card input {
  width: 100%; padding: 14px 16px;
  background: #1a1a1a;
  border: 1px solid #333;
  color: #d4d4a8; font-size: 16px;
  font-family: 'Share Tech Mono', monospace;
  outline: none; margin-bottom: 12px;
  letter-spacing: 2px;
  min-height: 48px;
}
.login-card input:focus { border-color: #5a6b3f; }
.login-card input::placeholder { color: #333; letter-spacing: 2px; }
.login-card button {
  width: 100%; padding: 14px;
  background: #3d4a2e;
  border: 2px solid #5a6b3f;
  color: #d4d4a8; font-size: 14px;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 3px;
  cursor: pointer;
  min-height: 48px;
}
.login-card button:active { background: #4a5a36; }
.login-error {
  color: #c44; font-size: 12px; margin-top: 10px; min-height: 18px;
}

/* ===== TOP BAR ===== */
.top-bar {
  padding: 16px 16px 12px;
  display: flex; align-items: center; justify-content: space-between;
}
.back-btn {
  background: none; border: none;
  color: #555; font-size: 13px;
  font-family: 'Share Tech Mono', monospace;
  cursor: pointer; padding: 8px 0;
  text-transform: uppercase; letter-spacing: 1px;
}
.back-btn:active { color: #d4d4a8; }
.status-pill {
  font-size: 9px; color: #5a6b3f;
  background: rgba(90,107,63,0.15);
  padding: 3px 8px;
  border: 1px solid #5a6b3f;
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 1px;
}

/* ===== SCREEN HEADER ===== */
.screen-header {
  padding: 0 16px 16px;
}
.screen-header h1 {
  font-size: 22px; color: #d4d4a8; margin-bottom: 4px;
  letter-spacing: 3px;
}
.screen-header p {
  font-size: 11px; color: #444;
  text-transform: uppercase; letter-spacing: 2px;
}
.screen-header .sub {
  font-size: 10px; color: #333; margin-top: 4px;
  letter-spacing: 1px;
}

/* ===== WEEK GRID ===== */
.week-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 16px 20px;
}
.week-card {
  background: #141414;
  border: 1px solid #2a2a22;
  padding: 16px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-family: inherit;
  color: inherit;
}
.week-card:active { background: #1a1a1a; }
.week-card h3 {
  font-size: 14px; color: #d4d4a8; letter-spacing: 2px; margin-bottom: 12px;
}
.progress-bar {
  height: 3px; background: #222; overflow: hidden; margin-bottom: 8px;
}
.progress-fill {
  height: 100%; background: #5a6b3f;
  transition: width 0.3s;
}
.week-card .stat {
  font-size: 10px; color: #444;
  letter-spacing: 1px;
}

/* ===== WEEKLY STRUCTURE ===== */
.structure-block {
  margin: 0 16px 20px;
  padding: 14px;
  background: #141414;
  border: 1px solid #1a1a16;
}
.structure-block h4 {
  font-size: 10px; color: #444; letter-spacing: 2px; margin-bottom: 10px;
}
.structure-row {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 0;
}
.structure-day {
  font-size: 10px; color: #5a6b3f; font-weight: 700;
  width: 30px; flex-shrink: 0; letter-spacing: 1px;
  font-family: 'Oswald', sans-serif;
}
.structure-label {
  font-size: 11px; color: #666;
}

/* ===== DAY LIST ===== */
.day-list {
  display: flex; flex-direction: column;
  gap: 6px; padding: 0 12px 20px;
}
.day-btn {
  background: #141414;
  border: 1px solid #2a2a22;
  border-left: 3px solid #5a6b3f;
  padding: 14px 14px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-family: inherit;
  color: inherit;
}
.day-btn:active { background: #1a1a1a; }
.day-btn.done { opacity: 0.45; }
.day-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 4px;
}
.day-label {
  font-family: 'Oswald', sans-serif;
  font-size: 11px; color: #5a6b3f; font-weight: 600;
  letter-spacing: 2px; margin-right: 8px;
}
.day-name {
  font-family: 'Oswald', sans-serif;
  font-size: 15px; color: #d4d4a8; font-weight: 600;
  letter-spacing: 1px;
}
.done-mark {
  font-family: 'Oswald', sans-serif;
  color: #5a6b3f; font-size: 16px; font-weight: 700;
}
.day-sub {
  font-size: 12px; color: #555; margin-bottom: 6px;
}
.day-meta {
  font-size: 10px; color: #333; letter-spacing: 1px;
}

/* ===== WORKOUT VIEW ===== */
.workout-header {
  padding: 0 16px 12px;
  border-bottom: 1px solid #1a1a16;
  margin-bottom: 8px;
}
.workout-header .dot {
  display: inline-block;
  width: 10px; height: 10px;
  background: #5a6b3f;
  margin-right: 8px;
}
.workout-header h1 {
  font-size: 18px; color: #d4d4a8;
  display: inline; letter-spacing: 2px;
}
.workout-header p {
  font-size: 11px; color: #444; margin-top: 4px;
  text-transform: uppercase; letter-spacing: 1px;
}
.workout-header .week-indicator {
  font-size: 10px; color: #333; margin-top: 4px;
  letter-spacing: 1px;
}

/* ===== SECTION HEADER ===== */
.section-title {
  padding: 12px 16px 6px;
  font-family: 'Oswald', sans-serif;
  font-size: 10px; color: #5a6b3f; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase;
}
.section-note {
  padding: 0 16px 8px;
  font-size: 11px; color: #333; line-height: 1.4;
}

/* ===== EXERCISE CARD ===== */
.ex-list {
  display: flex; flex-direction: column;
  gap: 4px; padding: 0 12px 6px;
}
.ex-card {
  background: #141414;
  overflow: hidden;
}
.ex-header {
  width: 100%; padding: 12px 12px 4px;
  display: flex; justify-content: space-between; align-items: flex-start;
  cursor: pointer; background: none; border: none;
  font-family: inherit; color: inherit; text-align: left;
}
.ex-header:active { background: #1a1a1a; }
.ex-left { display: flex; flex-direction: column; gap: 3px; }
.ex-tag {
  display: inline-block;
  font-size: 9px; font-weight: 600;
  letter-spacing: 1.5px;
  padding: 2px 6px;
  border: 1px solid;
  font-family: 'Share Tech Mono', monospace;
}
.ex-tag-squat { color: #b43232; border-color: #b4323244; background: #b4323218; }
.ex-tag-push { color: #5a6b3f; border-color: #5a6b3f44; background: #5a6b3f18; }
.ex-tag-pull { color: #5088a0; border-color: #5088a044; background: #5088a018; }
.ex-tag-hinge { color: #b4a028; border-color: #b4a02844; background: #b4a02818; }
.ex-tag-carry { color: #8a6aaa; border-color: #8a6aaa44; background: #8a6aaa18; }
.ex-tag-rotate { color: #c4843a; border-color: #c4843a44; background: #c4843a18; }
.ex-tag-iso { color: #5088a0; border-color: #5088a044; background: #5088a018; }
.ex-tag-speed { color: #b43232; border-color: #b4323244; background: #b4323218; }
.ex-tag-conditioning { color: #5a6b3f; border-color: #5a6b3f44; background: #5a6b3f18; }

.ex-name {
  font-family: 'Oswald', sans-serif;
  font-size: 14px; color: #d4d4a8; font-weight: 600;
  letter-spacing: 0.5px; text-transform: uppercase;
}
.ex-right {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.ex-filled {
  font-size: 11px; color: #5a6b3f;
  letter-spacing: 1px;
}
.ex-toggle {
  color: #333; font-size: 12px;
  font-family: 'Oswald', sans-serif;
  transition: transform 0.2s;
}
.ex-card.open .ex-toggle { transform: rotate(180deg); }

.ex-meta {
  padding: 0 12px 10px;
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
}
.ex-prescription {
  font-size: 11px; color: #555;
}
.ex-note-tag {
  font-size: 9px; padding: 2px 6px;
  border: 1px solid;
  letter-spacing: 1px;
}
.ex-note-rpe { color: #5a6b3f; border-color: #5a6b3f44; background: #5a6b3f11; }
.ex-note-info { color: #b43232; border-color: #b4323222; background: #b4323211; }
.ex-note-prev { color: #c4843a; border-color: #c4843a44; background: #c4843a18; }

/* ===== SET INPUTS ===== */
.set-inputs {
  padding: 4px 10px 10px;
  display: none;
  flex-direction: column; gap: 4px;
}
.ex-card.open .set-inputs { display: flex; }

.set-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: #111;
}
.set-row.has-data { background: #0f1a0f; }
.set-label {
  font-family: 'Oswald', sans-serif;
  font-size: 11px; color: #444;
  letter-spacing: 1px; width: 28px; flex-shrink: 0;
}
.input-col {
  display: flex; flex-direction: column; align-items: center; flex: 1;
}
.input-field {
  width: 100%; padding: 10px 6px;
  background: #1a1a1a;
  border: 1px solid #2a2a22;
  color: #d4d4a8; font-size: 18px;
  font-family: 'Share Tech Mono', monospace;
  font-weight: 700;
  text-align: center;
  outline: none;
  min-height: 48px;
  -webkit-appearance: none;
  -moz-appearance: textfield;
}
.input-field:focus { border-color: #5a6b3f; }
.input-field::placeholder { color: #2a2a22; font-size: 14px; font-weight: 400; }
.input-label {
  font-size: 8px; color: #333;
  letter-spacing: 2px; margin-top: 2px;
  font-family: 'Oswald', sans-serif;
}
.multiply {
  color: #2a2a22; font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}

.prev-set-hint {
  display: flex; align-items: center; gap: 6px;
  padding: 2px 0 2px 38px;
}
.prev-set-hint span:first-child {
  font-size: 9px; color: #c4843a55;
}
.prev-set-hint span:last-child {
  font-size: 9px; color: #c4843a;
}

/* ===== COMPLETE BUTTON ===== */
.complete-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  padding: 12px 16px 28px;
  background: linear-gradient(transparent, #0c0c0c 30%);
  z-index: 10;
  display: flex; justify-content: center;
}
.complete-btn {
  width: 100%; max-width: 520px;
  padding: 16px;
  border: 2px solid #5a6b3f;
  font-family: 'Oswald', sans-serif;
  font-size: 14px; font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  cursor: pointer;
  min-height: 52px;
}
.complete-btn.active {
  background: #3d4a2e; color: #d4d4a8;
}
.complete-btn.completed {
  background: #1a1a1a; color: #444;
  border-color: #333;
}
.complete-btn:active { opacity: 0.8; }

/* ===== BOTTOM SPACER (for fixed button) ===== */
.bottom-spacer { height: 100px; }

/* ===== LOADING ===== */
.loading {
  text-align: center; padding: 60px 20px;
  color: #333; font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

/* ===== RESPONSIVE — LARGER SCREENS ===== */
@media (min-width: 640px) {
  .login-card { padding: 48px 40px; }
  .set-row { gap: 12px; }
  .input-field { font-size: 20px; }
}

/* Remove number input spinners */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none; margin: 0;
}
input[type=number] { -moz-appearance: textfield; }
