:root {
  --black: #171616;
  --ink: #242124;
  --charcoal: #302d31;
  --pink: #e4a4bc;
  --hot-pink: #f35f9d;
  --blush: #f8dce8;
  --ivory: #fff9f5;
  --pearl: #f6eef2;
  --muted: #8d7f86;
  --line: rgba(23, 22, 22, 0.12);
  --shadow: 0 18px 44px rgba(23, 22, 22, 0.16);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--black);
  background:
    linear-gradient(180deg, rgba(255, 249, 245, 0.96), rgba(246, 238, 242, 0.96)),
    repeating-linear-gradient(135deg, rgba(23, 22, 22, 0.035) 0 1px, transparent 1px 18px);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

body[data-authenticated="true"] {
  padding-bottom: 86px;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.app-shell {
  overflow: hidden;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(160deg, rgba(23, 22, 22, 0.94), rgba(48, 45, 49, 0.88)),
    linear-gradient(90deg, transparent, rgba(228, 164, 188, 0.12), transparent);
}

.login-panel {
  width: min(100%, 420px);
  border: 1px solid rgba(255, 249, 245, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 249, 245, 0.96);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.3);
  padding: 24px;
}

.login-brand,
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.34rem;
  font-weight: 700;
  letter-spacing: 0;
}

.login-brand {
  margin-bottom: 28px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(23, 22, 22, 0.18);
  background: var(--black);
  color: var(--pink);
}

.login-panel h1,
.hero h1,
.section-heading h2,
.panel h3,
.hero-card h2,
.plan-note h3,
.history-header h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  letter-spacing: 0;
}

.login-panel h1 {
  margin: 0;
  font-size: 3.4rem;
  line-height: 0.92;
}

.login-copy {
  margin: 16px 0 24px;
  color: var(--charcoal);
}

.login-form,
.form-grid {
  display: grid;
  gap: 12px;
}

.login-form label,
.form-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.form-message {
  min-height: 20px;
  margin: 12px 0 0;
  color: #7a5f6a;
  font-size: 0.82rem;
  font-weight: 800;
}

.form-message.is-error,
#loginError:not(:empty) {
  color: #a52748;
}

.hero {
  color: var(--ivory);
  background:
    linear-gradient(160deg, rgba(23, 22, 22, 0.98), rgba(23, 22, 22, 0.88) 54%, rgba(64, 35, 48, 0.92)),
    repeating-linear-gradient(90deg, transparent 0 28px, rgba(228, 164, 188, 0.035) 28px 29px);
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 90px;
  background: linear-gradient(transparent, var(--ivory));
  pointer-events: none;
}

.topbar {
  width: min(1120px, calc(100% - 28px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  position: relative;
  z-index: 3;
}

.topbar .brand-mark {
  border-color: rgba(255, 249, 245, 0.4);
  background: rgba(255, 249, 245, 0.06);
}

.nav-actions {
  position: fixed;
  z-index: 20;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  border: 1px solid rgba(255, 249, 245, 0.14);
  border-radius: var(--radius);
  background: rgba(23, 22, 22, 0.94);
  box-shadow: 0 14px 46px rgba(0, 0, 0, 0.32);
  padding: 6px;
}

.nav-actions a,
.nav-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 249, 245, 0.78);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 800;
}

.nav-actions a:hover,
.nav-button:hover {
  background: rgba(228, 164, 188, 0.15);
  color: var(--ivory);
}

.hero-grid {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 122px;
  display: grid;
  gap: 16px;
  position: relative;
  z-index: 2;
}

.hero-copy {
  display: grid;
  gap: 18px;
}

.eyebrow,
.card-kicker {
  margin: 0 0 8px;
  color: var(--hot-pink);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: 4.1rem;
  line-height: 0.82;
  font-weight: 700;
}

.hero-text {
  margin: 0;
  color: rgba(255, 249, 245, 0.78);
  font-size: 1rem;
}

.hero-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0 18px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
}

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

.button.primary {
  background: var(--pink);
  color: var(--black);
  box-shadow: 0 14px 32px rgba(228, 164, 188, 0.24);
}

.button.ghost {
  color: var(--ivory);
  border-color: rgba(255, 249, 245, 0.34);
  background: rgba(255, 249, 245, 0.06);
}

.hero-media {
  height: 580px;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 249, 245, 0.18);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 52% 58%, rgba(228, 164, 188, 0.2), transparent 34%),
    linear-gradient(115deg, rgba(255, 255, 255, 0.98), #fff 44%, rgba(255, 249, 245, 0.98));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.26);
  position: relative;
}

.hero-media::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: 50%;
  bottom: 34px;
  width: min(78%, 390px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(228, 164, 188, 0.34), rgba(228, 164, 188, 0.12) 48%, transparent 70%);
  filter: blur(0.5px);
  transform: translateX(-50%);
}

.hero-media::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: 18%;
  right: 18%;
  bottom: 22px;
  height: 18px;
  border-radius: 999px;
  background: radial-gradient(ellipse, rgba(23, 22, 22, 0.18), transparent 68%);
}

.hero-media img {
  position: absolute;
  z-index: 2;
  right: 50%;
  bottom: 0;
  width: auto;
  height: 94%;
  max-width: 62%;
  object-fit: contain;
  transform: translateX(50%);
  filter:
    brightness(1.04)
    saturate(1.08)
    contrast(1.04)
    drop-shadow(0 18px 26px rgba(23, 22, 22, 0.18))
    drop-shadow(0 0 28px rgba(228, 164, 188, 0.34));
}

.fashion-word {
  position: absolute;
  z-index: 1;
  color: rgba(23, 22, 22, 0.94);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 2.74rem;
  font-style: italic;
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: 0;
  white-space: nowrap;
  pointer-events: none;
  will-change: transform, opacity;
  animation-duration: 4.8s;
  animation-timing-function: cubic-bezier(0.18, 0.72, 0.18, 1);
  animation-fill-mode: forwards;
  animation-delay: 0.35s;
}

.fashion-word-left {
  left: 20px;
  top: 36%;
  animation-name: fashionWordLeft;
}

.fashion-word-right {
  right: 24px;
  top: 50%;
  animation-name: fashionWordRight;
}

@keyframes fashionWordLeft {
  0% {
    opacity: 0;
    transform: translateX(-18px);
  }

  18% {
    opacity: 0.96;
  }

  72% {
    opacity: 0.52;
  }

  100% {
    opacity: 0.18;
    transform: translateX(64px);
  }
}

@keyframes fashionWordRight {
  0% {
    opacity: 0;
    transform: translateX(18px);
  }

  18% {
    opacity: 0.96;
  }

  72% {
    opacity: 0.52;
  }

  100% {
    opacity: 0.18;
    transform: translateX(-58px);
  }
}

@media (max-width: 619px) {
  .fashion-word {
    animation-duration: 3.9s;
  }

  @keyframes fashionWordLeft {
    0% {
      opacity: 0;
      transform: translateX(-14px);
    }

    18% {
      opacity: 0.92;
    }

    72% {
      opacity: 0.5;
    }

    100% {
      opacity: 0.16;
      transform: translateX(42px);
    }
  }

  @keyframes fashionWordRight {
    0% {
      opacity: 0;
      transform: translateX(14px);
    }

    18% {
      opacity: 0.92;
    }

    72% {
      opacity: 0.5;
    }

    100% {
      opacity: 0.16;
      transform: translateX(-38px);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .fashion-word {
    animation: none;
    opacity: 0.28;
  }
}

.hero-card,
.panel,
.plan-note,
.history-wrap {
  border: 1px solid rgba(23, 22, 22, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 249, 245, 0.96);
  box-shadow: var(--shadow);
}

.hero-card {
  min-height: 318px;
  padding: 20px;
  color: var(--black);
  display: grid;
  gap: 18px;
}

.date-pill {
  justify-self: start;
  border: 1px solid rgba(23, 22, 22, 0.13);
  background: var(--black);
  color: var(--ivory);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.78rem;
  font-weight: 800;
}

.score-ring {
  width: 176px;
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, var(--ivory) 0 56%, transparent 57%),
    conic-gradient(var(--hot-pink) var(--progress-angle, 0deg), rgba(23, 22, 22, 0.11) 0);
  border: 1px solid rgba(23, 22, 22, 0.08);
}

.score-ring span {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 3.3rem;
  font-weight: 700;
}

.hero-card h2,
.section-heading h2,
.panel h3,
.history-header h3,
.plan-note h3 {
  margin: 0;
  color: var(--black);
  line-height: 1;
}

.hero-card h2 {
  font-size: 2.24rem;
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.mini-metrics div {
  min-width: 0;
}

.mini-metrics strong {
  display: block;
  font-size: 1rem;
}

.mini-metrics span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.section {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 54px 0;
}

.section-heading {
  margin-bottom: 20px;
}

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

.dashboard-grid,
.progress-grid,
.plan-grid {
  display: grid;
  gap: 14px;
}

.panel,
.history-wrap,
.plan-note {
  padding: 18px;
}

.panel-heading {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.panel h3,
.history-header h3,
.plan-note h3 {
  font-size: 2rem;
}

select,
input[type="number"],
input[type="password"],
input[type="text"] {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--black);
  padding: 0 12px;
  outline: none;
}

select:focus,
input:focus {
  border-color: var(--hot-pink);
  box-shadow: 0 0 0 4px rgba(243, 95, 157, 0.12);
}

.icon-button,
.text-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--black);
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 800;
}

.icon-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
}

.text-button {
  min-height: 40px;
  padding: 0 12px;
  color: #8a2d56;
}

.check-list,
.supplement-list,
.history-list {
  display: grid;
  gap: 10px;
}

.check-item,
.cardio-box {
  min-height: 66px;
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
}

.check-item:hover,
.cardio-box:hover,
.supplement-dose:hover {
  border-color: rgba(243, 95, 157, 0.38);
}

.check-item input,
.cardio-box input,
.supplement-dose input {
  width: 23px;
  height: 23px;
  accent-color: var(--hot-pink);
}

.check-item strong,
.cardio-box strong {
  display: block;
  overflow-wrap: anywhere;
}

.check-item small,
.cardio-box small {
  display: block;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.35;
}

.check-item.completed,
.cardio-box.completed,
.supplement-dose.completed {
  background: linear-gradient(135deg, rgba(228, 164, 188, 0.26), rgba(255, 255, 255, 0.96));
  border-color: rgba(243, 95, 157, 0.42);
}

.cardio-box {
  margin-top: 12px;
}

.legend {
  display: none;
}

.supplement-row {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
}

.supplement-name,
.supplement-dose {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
}

.supplement-name {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.supplement-name strong {
  overflow-wrap: anywhere;
}

.supplement-name small {
  color: var(--muted);
  font-weight: 700;
}

.supplement-dose {
  display: grid;
  grid-template-columns: auto 24px 1fr;
  align-items: center;
  gap: 9px;
  padding: 10px;
  cursor: pointer;
}

.supplement-dose::before {
  content: attr(data-time);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.supplement-dose span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.86rem;
  font-weight: 800;
}

.supplement-dose.is-empty {
  display: none;
}

.form-button {
  width: 100%;
  margin-top: 16px;
}

.stats-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat {
  min-height: 104px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--black);
  color: var(--ivory);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat span {
  color: rgba(255, 249, 245, 0.68);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat strong {
  color: var(--pink);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.9rem;
  line-height: 1;
}

.history-wrap {
  margin-top: 14px;
  box-shadow: none;
}

.history-header {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.history-item {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.74);
}

.history-item span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.history-item strong,
.history-item p {
  margin: 0;
  overflow-wrap: anywhere;
}

.history-empty {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.plan-note {
  box-shadow: none;
}

.plan-note p {
  margin: 16px 0 0;
  color: var(--charcoal);
}

.plan-photo {
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(23, 22, 22, 0.1);
  border-radius: var(--radius);
  background: var(--black);
  box-shadow: var(--shadow);
}

.plan-photo img {
  width: 100%;
  max-height: 780px;
  object-fit: cover;
  object-position: center top;
}

@media (min-width: 620px) {
  body[data-authenticated="true"] {
    padding-bottom: 0;
  }

  .hero-actions {
    grid-template-columns: repeat(2, minmax(0, 180px));
  }

  .topbar {
    min-height: 76px;
  }

  .nav-actions {
    position: static;
    display: flex;
    width: auto;
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
  }

  .nav-actions a,
  .nav-button {
    min-height: 40px;
    padding: 0 12px;
    font-size: 0.86rem;
  }

  .nav-button {
    border: 1px solid rgba(255, 249, 245, 0.2);
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.74fr);
    grid-template-areas:
      "copy card"
      "media card";
    align-items: center;
    padding: 42px 0 120px;
    gap: 18px;
  }

  .hero-copy {
    grid-area: copy;
  }

  .hero-media {
    grid-area: media;
    height: 620px;
  }

  .hero-media img {
    height: 94%;
    max-width: 68%;
  }

  .fashion-word {
    font-size: 3.45rem;
  }

  .hero-card {
    grid-area: card;
    min-height: 430px;
  }

  .hero h1 {
    font-size: 6.2rem;
  }

  .hero-text {
    max-width: 560px;
    font-size: 1.08rem;
  }

  .score-ring {
    width: 210px;
  }

  .score-ring span {
    font-size: 4.5rem;
  }

  .hero-card h2 {
    font-size: 2.8rem;
  }

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

  .panel-heading,
  .history-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
  }

  .panel-heading select {
    max-width: 180px;
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .history-item {
    grid-template-columns: minmax(120px, 0.75fr) repeat(3, minmax(74px, 0.45fr)) minmax(180px, 1.25fr);
    align-items: center;
  }
}

@media (min-width: 920px) {
  .login-panel {
    padding: 32px;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1.06fr) minmax(330px, 0.72fr);
    min-height: calc(92vh - 76px);
  }

  .hero h1 {
    font-size: 8.4rem;
  }

  .hero-media {
    height: 680px;
  }

  .hero-media img {
    height: 95%;
    max-width: 62%;
  }

  .fashion-word {
    font-size: 4.1rem;
  }

  .fashion-word-left {
    left: 26px;
  }

  .fashion-word-right {
    right: 30px;
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
    gap: 18px;
    align-items: start;
  }

  .dashboard-grid .supplements-panel {
    grid-column: 1 / -1;
  }

  .progress-grid {
    grid-template-columns: minmax(0, 1.32fr) minmax(280px, 0.68fr);
    gap: 18px;
    align-items: stretch;
  }

  .plan-grid {
    grid-template-columns: minmax(280px, 0.55fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
  }

  .legend {
    display: grid;
    grid-template-columns: 1.2fr repeat(3, minmax(78px, 0.32fr));
    gap: 8px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }

  .legend::before {
    content: "Suplemento";
  }

  .supplement-row {
    grid-template-columns: 1.2fr repeat(3, minmax(78px, 0.32fr));
    padding: 0;
    border: 0;
    background: transparent;
  }

  .supplement-dose {
    grid-template-columns: 24px 1fr;
  }

  .supplement-dose::before {
    content: none;
  }

  .supplement-dose.is-empty {
    display: grid;
    opacity: 0.34;
    cursor: default;
  }

  .supplement-dose.is-empty input {
    visibility: hidden;
  }

  .section {
    padding: 86px 0;
  }
}
