/*====================================================
    DEFICIT
    Global Styles
=====================================================*/

:root {
  /* Colors */

  --bg: #000000;
  --surface: #121212;
  --surface-light: #1c1c1c;

  --text: #ffffff;
  --text-secondary: #9b9b9b;

  --accent: #39ff14;
  --accent-dark: #2ee40e;

  --border: #2d2d2d;

  --danger: #ff4d4d;

  /* Radius */

  --radius-small: 12px;
  --radius: 16px;
  --radius-large: 28px;

  /* Shadows */

  --shadow: 0 20px 60px rgba(0, 0, 0, 0.55);

  --glow: 0 0 15px rgba(57, 255, 20, 0.25);

  /* Animation */

  --transition: 0.25s ease;
}

/*====================================================
    RESET
=====================================================*/

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

html {
  font-size: 16px;
}

body {
  font-family: "Outfit", sans-serif;

  background: var(--bg);

  color: var(--text);

  min-height: 100svh;

  display: flex;

  justify-content: center;

  align-items: flex-start;

  padding: 60px 20px;

  overflow-y: auto;

  overflow-x: hidden;
}

/*====================================================
    BACKGROUND
=====================================================*/

.background-glow {
  position: fixed;

  top: -250px;

  right: -180px;

  width: 600px;

  height: 600px;

  background: var(--accent);

  filter: blur(200px);

  opacity: 0.08;

  pointer-events: none;

  z-index: -1;
}

/*====================================================
    LOGIN CARD
=====================================================*/

.login-container {
  width: min(420px, 100%);

  margin: auto;

  background: var(--surface);

  border: 1px solid var(--border);

  border-radius: var(--radius-large);

  padding: 42px 32px;

  box-shadow: var(--shadow);

  display: flex;

  flex-direction: column;

  align-items: center;
}

/*====================================================
    LOGO
=====================================================*/

.logo {
  width: 220px;

  margin-bottom: 28px;

  user-select: none;

  border-radius: 20px;
}

/*====================================================
    TYPOGRAPHY
=====================================================*/

h1 {
  font-size: 2rem;

  font-weight: 700;

  margin-bottom: 10px;
}

.subtitle {
  color: var(--text-secondary);

  text-align: center;

  line-height: 1.6;

  margin-bottom: 36px;
}

/*====================================================
    FORM
=====================================================*/

form {
  width: 100%;
}

.input-group {
  margin-bottom: 22px;
}

.input-group label {
  display: block;

  margin-bottom: 8px;

  font-size: 0.95rem;

  font-weight: 500;
}

input {
  width: 100%;

  background: #000;

  color: white;

  border: 2px solid var(--border);

  border-radius: var(--radius);

  padding: 16px;

  font-size: 1rem;

  transition: var(--transition);

  outline: none;
}

input::placeholder {
  color: #666;
}

input:focus {
  border-color: var(--accent);

  box-shadow: var(--glow);
}

/*====================================================
    LOGIN OPTIONS
=====================================================*/

.login-options {
  display: flex;

  justify-content: space-between;

  align-items: center;

  margin-bottom: 28px;

  gap: 12px;
}

.remember-me {
  display: flex;

  align-items: center;

  gap: 10px;

  cursor: pointer;

  color: var(--text-secondary);

  font-size: 0.92rem;

  user-select: none;
}

.remember-me input {
  display: none;
}

.checkmark {
  width: 18px;

  height: 18px;

  border: 2px solid var(--border);

  border-radius: 6px;

  background: #000;

  position: relative;

  transition: var(--transition);
}

.remember-me input:checked + .checkmark {
  background: var(--accent);

  border-color: var(--accent);
}

.remember-me input:checked + .checkmark::after {
  content: "✓";

  position: absolute;

  top: 50%;

  left: 50%;

  transform: translate(-50%, -58%);

  color: #000;

  font-size: 0.8rem;

  font-weight: 700;
}

.forgot-password {
  color: var(--text-secondary);

  text-decoration: none;

  font-size: 0.9rem;

  transition: var(--transition);
}

.forgot-password:hover {
  color: var(--text);
}

/*====================================================
    BUTTONS
=====================================================*/

.login-btn {
  width: 100%;

  border: none;

  background: var(--accent);

  color: #000;

  padding: 16px;

  border-radius: var(--radius);

  font-size: 1rem;

  font-weight: 700;

  cursor: pointer;

  transition: var(--transition);
}

.login-btn:hover {
  transform: translateY(-2px);

  box-shadow:
    0 0 15px rgba(57, 255, 20, 0.45),
    0 0 35px rgba(57, 255, 20, 0.18);
}

.login-btn:active {
  transform: scale(0.98);
}

/*====================================================
    DIVIDER
=====================================================*/

.divider {
  width: 100%;

  display: flex;

  align-items: center;

  gap: 12px;

  margin: 34px 0 28px;

  color: #666;
}

.divider::before,
.divider::after {
  content: "";

  flex: 1;

  height: 1px;

  background: var(--border);
}

/*====================================================
    CREATE ACCOUNT
=====================================================*/

.create-account {
  color: var(--text);

  text-decoration: none;

  font-weight: 600;

  transition: var(--transition);
}

.create-account:hover {
  color: var(--accent);
}

/*====================================================
    APP PAGES (profile / weight / workouts / calories / settings)
=====================================================*/

.page {
  width: min(420px, 100%);

  margin: auto;

  padding-bottom: 110px;
}

.hero {
  margin-bottom: 36px;
}

.greeting {
  color: var(--text-secondary);

  margin-bottom: 6px;
}

.card-header {
  color: var(--text-secondary);

  font-size: 0.95rem;

  margin-bottom: 14px;
}

.stat-card {
  background: var(--surface);

  border: 1px solid var(--border);

  border-radius: 22px;

  padding: 22px;

  margin-bottom: 18px;
}

.stat-card h2 {
  font-size: 1rem;

  color: var(--text-secondary);

  margin-bottom: 12px;
}

.stat-number {
  font-size: 2rem;

  font-weight: 700;
}

/*====================================================
    BOTTOM NAVIGATION
=====================================================*/

.bottom-nav {
  position: fixed;

  left: 0;

  bottom: 0;

  width: 100%;

  height: 76px;

  background: rgba(10, 10, 10, 0.96);

  border-top: 1px solid var(--border);

  display: flex;

  justify-content: space-around;

  align-items: center;

  backdrop-filter: blur(20px);
}

.bottom-nav a {
  display: flex;
  align-items: center;
  justify-content: center;

  color: var(--text-secondary);

  text-decoration: none;

  transition: 0.2s;
}

.bottom-nav a svg {
  width: 28px;
  height: 28px;
  display: block;
  transition: 0.2s ease;
}

/* Force every icon path to follow the link's color, regardless of
   whether the SVG file itself has a fill attribute or not — this is
   what was missing before, causing icons to default to black. */
.bottom-nav a svg path {
  fill: currentColor;
}

/* ...except the invisible bounding-box rectangle some icon exports
   include, which must stay non-rendering. */
.bottom-nav a svg path[fill="none"] {
  fill: none;
}

.bottom-nav a:hover {
  color: white;
}

.bottom-nav a.active {
  color: var(--accent);
}

.bottom-nav a.active svg {
  transform: scale(1.15);
  filter: drop-shadow(0 0 6px rgba(57, 255, 20, 0.65));
}

/*====================================================
    SIGN UP PAGE
=====================================================*/

#signup-form {
  width: 100%;
}

#signup-form .login-btn {
  margin-top: 12px;
}

/*====================================================
    WORKOUTS PAGE
=====================================================*/

.hidden {
  display: none !important;
}

.empty-note {
  color: var(--text-secondary);

  font-size: 0.9rem;

  padding: 8px 0;
}

/* ---------------- */
/* Exercise chips */
/* ---------------- */

.chip-list {
  display: flex;

  flex-wrap: wrap;

  gap: 10px;

  margin-bottom: 18px;
}

.chip {
  display: flex;

  align-items: center;

  gap: 8px;

  background: var(--surface-light);

  border: 1px solid var(--border);

  border-radius: 999px;

  padding: 8px 8px 8px 16px;

  font-size: 0.9rem;
}

.chip-delete {
  background: none;

  border: none;

  color: var(--text-secondary);

  font-size: 1.1rem;

  line-height: 1;

  cursor: pointer;

  padding: 4px 8px;

  border-radius: 50%;

  transition: var(--transition);
}

.chip-delete:hover {
  background: var(--danger);

  color: white;
}

/* ---------------- */
/* Inline add row */
/* ---------------- */

.add-inline-row {
  display: flex;

  gap: 10px;

  flex-wrap: wrap;
}

.add-inline-row input {
  flex: 2;

  min-width: 120px;

  padding: 12px 14px;

  font-size: 0.95rem;
}

.add-inline-row select {
  flex: 1;

  min-width: 100px;

  background: #000;

  color: white;

  border: 2px solid var(--border);

  border-radius: var(--radius);

  padding: 12px 10px;

  font-size: 0.9rem;
}

.add-btn {
  border: none;

  background: var(--accent);

  color: #000;

  padding: 12px 18px;

  border-radius: var(--radius);

  font-weight: 700;

  cursor: pointer;

  transition: var(--transition);

  white-space: nowrap;
}

.add-btn:hover {
  transform: translateY(-2px);

  box-shadow: 0 0 15px rgba(57, 255, 20, 0.35);
}

.add-btn.full-width {
  width: 100%;

  margin-top: 4px;
}

/* ---------------- */
/* Session / set logging */
/* ---------------- */

#session-log {
  margin-top: 16px;
}

.add-set-form {
  display: flex;

  flex-direction: column;

  gap: 12px;

  margin-bottom: 20px;
}

.add-set-form select {
  background: #000;

  color: white;

  border: 2px solid var(--border);

  border-radius: var(--radius);

  padding: 14px;

  font-size: 0.95rem;
}

.field-row {
  display: flex;

  gap: 10px;
}

.field-row input {
  flex: 1;

  padding: 14px;

  font-size: 0.95rem;
}

.set-list {
  display: flex;

  flex-direction: column;

  gap: 10px;
}

.set-row {
  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 10px;

  background: var(--surface-light);

  border: 1px solid var(--border);

  border-radius: var(--radius-small);

  padding: 12px 14px;
}

.set-exercise-name {
  font-weight: 600;

  flex: 1;
}

.set-summary {
  color: var(--text-secondary);

  font-size: 0.9rem;
}

.set-delete {
  background: none;

  border: none;

  color: var(--text-secondary);

  font-size: 1.2rem;

  line-height: 1;

  cursor: pointer;

  padding: 4px 8px;

  border-radius: 50%;

  transition: var(--transition);
}

.set-delete:hover {
  background: var(--danger);

  color: white;
}

/* ---------------- */
/* Chart filter */
/* ---------------- */

.chart-filter {
  width: 100%;

  background: #000;

  color: white;

  border: 2px solid var(--border);

  border-radius: var(--radius);

  padding: 12px 14px;

  font-size: 0.95rem;

  margin-bottom: 16px;
}

/* ---------------- */
/* Chart metric toggle */
/* ---------------- */

.metric-toggle {
  display: flex;

  gap: 10px;

  margin-top: 16px;
}

.metric-btn {
  flex: 1;

  background: transparent;

  color: var(--text-secondary);

  border: 2px solid var(--border);

  border-radius: var(--radius);

  padding: 12px;

  font-size: 0.9rem;

  font-weight: 700;

  cursor: pointer;

  transition: var(--transition);
}

.metric-btn:hover:not(:disabled) {
  border-color: var(--text-secondary);

  color: var(--text);
}

.metric-btn.active[data-metric-type="quality"] {
  background: var(--accent);

  border-color: var(--accent);

  color: #000;
}

.metric-btn.active[data-metric-type="quantity"] {
  background: #14e5ff;

  border-color: #14e5ff;

  color: #000;
}

.metric-btn:disabled {
  opacity: 0.35;

  cursor: not-allowed;
}

.field-hint {
  color: var(--text-secondary);

  font-size: 0.8rem;

  margin-top: -6px;
}

/* ---------------- */
/* Delete confirmation modal */
/* ---------------- */

.modal-overlay {
  position: fixed;

  inset: 0;

  background: rgba(0, 0, 0, 0.75);

  backdrop-filter: blur(6px);

  display: flex;

  align-items: center;

  justify-content: center;

  padding: 24px;

  z-index: 1000;
}

.modal-card {
  width: min(360px, 100%);

  background: var(--surface);

  border: 1px solid var(--danger);

  border-radius: var(--radius-large);

  padding: 32px 26px;

  text-align: center;

  box-shadow:
    0 0 30px rgba(255, 77, 77, 0.25),
    var(--shadow);
}

.modal-warning-icon {
  font-size: 2.2rem;

  margin-bottom: 6px;
}

.modal-title {
  color: var(--danger);

  font-size: 1.3rem;

  font-weight: 700;

  margin-bottom: 14px;
}

.modal-message {
  color: var(--text-secondary);

  font-size: 0.95rem;

  line-height: 1.5;

  margin-bottom: 26px;
}

.modal-message strong {
  color: var(--danger);
}

.modal-actions {
  display: flex;

  gap: 12px;
}

.modal-btn {
  flex: 1;

  border: none;

  border-radius: var(--radius);

  padding: 14px;

  font-size: 0.95rem;

  font-weight: 700;

  cursor: pointer;

  transition: var(--transition);
}

.modal-cancel {
  background: var(--surface-light);

  color: var(--text);

  border: 1px solid var(--border);
}

.modal-cancel:hover {
  background: var(--border);
}

.modal-danger {
  background: var(--danger);

  color: white;
}

.modal-danger:hover {
  transform: translateY(-2px);

  box-shadow: 0 0 18px rgba(255, 77, 77, 0.5);
}

/*====================================================
    MOBILE
=====================================================*/

@media (max-width: 430px) {
  body {
    padding: 32px 18px;
  }

  .login-container {
    padding: 34px 24px;

    border-radius: 22px;
  }

  .logo {
    width: 185px;

    margin-bottom: 22px;
  }

  h1 {
    font-size: 1.7rem;
  }
}

/*====================================================
    SHORT SCREENS
=====================================================*/

@media (max-height: 700px) {
  body {
    padding: 24px 16px;
  }

  .login-container {
    padding: 28px 24px;
  }

  .logo {
    width: 170px;

    margin-bottom: 18px;
  }

  h1 {
    font-size: 1.55rem;
  }

  .subtitle {
    margin-bottom: 24px;
  }
}
