/* ==========================================================================
   Estilos por página
   ========================================================================== */

/* ---------------- Auth ---------------- */
.auth {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.auth-aside {
  display: none;
}
.auth-main {
  display: grid;
  place-items: center;
  padding: calc(var(--safe-top) + var(--space-7)) var(--space-4) calc(var(--safe-bottom) + var(--space-7));
}
.auth-card {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  animation: fade-up calc(var(--dur) * 2) var(--ease-out) both;
}
.auth-title {
  font-size: var(--text-2xl);
  font-weight: 300;
  letter-spacing: -0.045em;
}
.auth-switch {
  font-size: var(--text-sm);
  text-align: center;
}
@media (min-width: 960px) {
  .auth {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  }
  .auth-aside {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: var(--space-7);
    border-right: 1px solid var(--border);
    overflow: hidden;
    background:
      radial-gradient(700px 500px at 20% 110%, color-mix(in oklab, var(--accent-2) calc(22% * var(--glow-strength)), transparent), transparent 70%),
      linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 100% 64px,
      linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 64px 100%;
  }
  .auth-aside::after {
    content: '';
    position: absolute;
    right: -140px;
    top: 18%;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    border: 1px solid var(--accent-2-line);
    box-shadow: 0 0 0 60px color-mix(in oklab, var(--accent-2) 4%, transparent), 0 0 0 140px color-mix(in oklab, var(--accent-2) 2.5%, transparent);
  }
  .auth-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
  }
  .auth-headline {
    font-size: clamp(2.5rem, 4.4vw, 4.25rem);
    font-weight: 250;
    letter-spacing: -0.055em;
    line-height: 1;
    margin-top: var(--space-4);
  }
  .auth-headline em {
    font-style: normal;
    color: var(--accent);
  }
  .auth-specs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
    border-top: 1px solid var(--border);
    padding-top: var(--space-5);
  }
  .auth-specs div {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .auth-specs b {
    font-size: var(--text-xl);
    font-weight: 300;
    letter-spacing: -0.03em;
  }
  .auth-specs small {
    color: var(--text-tertiary);
    font-size: var(--text-xs);
  }
}

/* ---------------- Daily thought ---------------- */
.thought {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: calc(var(--safe-top) + var(--space-5)) var(--space-5) calc(var(--safe-bottom) + var(--space-6));
  background:
    radial-gradient(800px 600px at 80% 10%, color-mix(in oklab, var(--accent-2) calc(18% * var(--glow-strength)), transparent), transparent 70%),
    radial-gradient(circle at 1px 1px, var(--dot) 1px, transparent 1.5px) 0 0 / 22px 22px,
    var(--background);
  opacity: 0;
  transition: opacity 700ms var(--ease-in-out);
}
.thought.is-in {
  opacity: 1;
}
.thought .thought-top,
.thought .thought-body,
.thought .thought-foot {
  opacity: 0;
  transition: opacity 900ms var(--ease-in-out);
}
.thought.is-in .thought-top {
  opacity: 1;
  transition-delay: 500ms;
}
.thought.is-in .thought-body {
  opacity: 1;
  transition-delay: 700ms;
}
.thought.is-in .thought-foot {
  opacity: 1;
  transition-delay: 1500ms;
}
.thought[data-leaving] .thought-top,
.thought[data-leaving] .thought-body,
.thought[data-leaving] .thought-foot {
  opacity: 0;
  transition: opacity 450ms var(--ease-in-out);
  transition-delay: 0ms;
}
.thought[data-leaving-bg] {
  opacity: 0;
  transition: opacity 650ms var(--ease-in-out);
}
@media (prefers-reduced-motion: reduce) {
  .thought,
  .thought * {
    transition: none !important;
  }
}
.thought-top {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.thought-body {
  margin: 0 auto;
  align-self: center;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.thought-mark {
  color: var(--accent);
  width: 28px;
}
.thought-body blockquote {
  margin: 0;
  font-size: clamp(1.75rem, 5.2vw, 3.25rem);
  font-weight: 250;
  line-height: 1.12;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.thought-body figcaption {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.thought-author {
  font-size: var(--text-md);
}
.thought-work {
  color: var(--text-secondary);
  font-style: italic;
}
.thought-foot {
  display: flex;
  justify-content: center;
}
.thought-foot .btn {
  min-width: 220px;
  min-height: 52px;
}

/* ---------------- Onboarding ---------------- */
.bare {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(var(--safe-top) + var(--space-5)) var(--space-4) calc(var(--safe-bottom) + var(--space-5));
}
.onboarding {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.onboarding-steps {
  display: flex;
  gap: 4px;
}
.onboarding-steps span {
  flex: 1;
  height: 3px;
  border-radius: 3px;
  background: var(--heat-empty);
  transition: background var(--dur);
}
.onboarding-steps span[data-done] {
  background: var(--accent);
}
.onboarding h1 {
  font-size: var(--text-2xl);
  font-weight: 300;
  letter-spacing: -0.045em;
}
.onboarding-foot {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
}

/* ---------------- Dashboard ---------------- */
.dash {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: minmax(0, 1fr);
}
.dash-hero {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-2) 0 var(--space-3);
}
.dash-hero h2 {
  font-size: var(--text-3xl);
  font-weight: 250;
  letter-spacing: -0.055em;
  line-height: 0.98;
}
.dash-hero h2 span {
  color: var(--text-tertiary);
}
.dash-status {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.dash-quote {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  max-width: 640px;
}
.dash-quote svg {
  width: 16px;
  flex: none;
  color: var(--accent-2);
  margin-top: 2px;
}
.dash-quote cite {
  font-style: normal;
  color: var(--text-tertiary);
  white-space: nowrap;
}
.pulse {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--border);
}
.pulse-cell {
  background: var(--surface);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}
.pulse-cell .kpi-value {
  font-size: var(--text-lg);
}
.money-hero {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.money-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}
.habit-today-head {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.timeline {
  display: flex;
  flex-direction: column;
}
.timeline-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
  min-height: 52px;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
}
.timeline-item:last-child {
  border-bottom: 0;
}
.timeline-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  gap: 3px;
}
.timeline-date b {
  font-size: var(--text-lg);
  font-weight: 300;
  letter-spacing: -0.03em;
}
.timeline-date small {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}
.score-inline {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

@media (min-width: 768px) {
  .dash {
    gap: var(--space-4);
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .dash > * {
    grid-column: span 6;
  }
  .dash .d-half {
    grid-column: span 3;
  }
  .pulse {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .pulse-cell .kpi-value {
    font-size: var(--text-xl);
    font-weight: 300;
  }
}
@media (min-width: 1180px) {
  .dash {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
  .dash > * {
    grid-column: span 12;
  }
  .dash .d-4 {
    grid-column: span 4;
  }
  .dash .d-5 {
    grid-column: span 5;
  }
  .dash .d-6,
  .dash .d-half {
    grid-column: span 6;
  }
  .dash .d-7 {
    grid-column: span 7;
  }
  .dash .d-8 {
    grid-column: span 8;
  }
  .dash-hero {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    padding: var(--space-4) 0 var(--space-4);
  }
}

/* ---------------- Hábitos ---------------- */
.habits-top {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: minmax(0, 1fr);
  margin-bottom: var(--space-5);
}
.week-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--space-1);
}
.week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  border-radius: var(--radius-sm);
  transition: background var(--dur-fast);
}
.week-day:hover:not([disabled]) {
  background: var(--surface-hover);
}
.week-day[disabled] {
  opacity: 0.4;
  cursor: default;
}
.week-day[aria-current='date'] .label {
  color: var(--accent);
}
.habit-filter {
  margin: 0 0 var(--space-4);
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.habit-filter::-webkit-scrollbar {
  display: none;
}
.habit-filter .chip {
  flex: none;
}
@media (min-width: 1180px) {
  .habits-top {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: var(--space-4);
  }
}
