:root {
  color-scheme: light;
  --ink: #17211d;
  --muted: #65706b;
  --line: #d9e2dc;
  --paper: #f6f7f3;
  --panel: #ffffff;
  --green: #1f8a64;
  --green-dark: #136145;
  --blue: #286a96;
  --coral: #d9664d;
  --amber: #e2a13a;
  --shadow: 0 18px 45px rgba(25, 43, 37, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  overscroll-behavior-y: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  background: #eef3ee;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span,
.subscription-panel p,
.metric span,
.eyebrow,
label,
.lesson-card p,
.feature-list p,
.journal-list p,
.trigger-list p,
.checklist span,
.breath-card small {
  color: var(--muted);
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  padding: 0 12px;
  text-align: left;
}

.nav-item.active,
.nav-item:hover {
  background: #fff;
  border-color: var(--line);
}

.icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--green-dark);
  font-weight: 700;
}

.subscription-panel {
  margin-top: auto;
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.subscription-panel p {
  margin: 4px 0 0;
  font-size: 0.9rem;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--coral);
}

.status-dot.active {
  background: var(--green);
}

.main-area {
  min-width: 0;
  padding: 28px;
}

.topbar,
.section-heading,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 24px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1;
}

h2 {
  margin-bottom: 14px;
  font-size: 1.25rem;
  line-height: 1.2;
}

.eyebrow {
  margin-bottom: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 22px;
  align-items: stretch;
  min-height: 260px;
  margin-bottom: 22px;
  padding: 28px;
  border-radius: 8px;
  background:
    linear-gradient(110deg, rgba(18, 97, 69, 0.92), rgba(40, 106, 150, 0.76)),
    url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=1600&q=80");
  background-position: center;
  background-size: cover;
  color: #fff;
  box-shadow: var(--shadow);
}

.hero-band .eyebrow,
.hero-band p {
  color: rgba(255, 255, 255, 0.84);
}

.hero-band h2 {
  max-width: 760px;
  margin-bottom: 12px;
  font-size: clamp(2rem, 5vw, 4.6rem);
  line-height: 0.98;
}

.hero-band p {
  max-width: 680px;
  font-size: 1.08rem;
}

.breath-card {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  text-align: center;
}

.breath-card span {
  font-weight: 800;
}

.breath-circle {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  animation: breathe 5s ease-in-out infinite;
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(0.72);
  }
  50% {
    transform: scale(1);
  }
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.metric,
.panel,
.lesson-card,
.result-box,
.goal-preview,
.install-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 18px rgba(25, 43, 37, 0.04);
}

.metric {
  min-height: 112px;
  padding: 18px;
}

.metric span,
.metric strong {
  display: block;
}

.metric strong {
  margin-top: 14px;
  color: var(--green-dark);
  font-size: 1.75rem;
}

.content-row,
.calculator-grid,
.journal-layout,
.admin-layout,
.install-layout,
.install-steps {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.panel {
  padding: 20px;
}

.checklist,
.trigger-list,
.feature-list,
.journal-list,
.savings-list {
  display: grid;
  gap: 10px;
}

.check-item,
.trigger-item,
.feature-item,
.journal-item,
.savings-list div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  min-height: 48px;
  padding: 12px;
  border-radius: 8px;
  background: #f7faf7;
}

.check-item {
  align-items: center;
}

.check-item input {
  width: 20px;
  height: 20px;
  accent-color: var(--green);
}

.trigger-item,
.feature-item,
.journal-item {
  display: block;
}

.trigger-item strong,
.feature-item strong {
  display: block;
  margin-bottom: 4px;
}

.trigger-item p,
.feature-item p,
.journal-item p {
  margin-bottom: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #e6f1eb;
  color: var(--green-dark);
  font-weight: 800;
}

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.lesson-card {
  position: relative;
  display: grid;
  gap: 12px;
  min-height: 230px;
  padding: 16px;
  overflow: hidden;
}

.lesson-card.locked::after {
  content: "Bloqueado";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(246, 247, 243, 0.88);
  color: var(--coral);
  font-weight: 900;
}

.video-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 8px;
  background: #e1e8e2;
}

.placeholder-video {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: #e8f0ed;
  color: var(--blue);
  font-weight: 900;
}

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

.form-grid.compact {
  margin: 18px 0;
}

.wide {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 7px;
  font-size: 0.9rem;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 1rem;
  padding: 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 138, 100, 0.14);
}

.result-box {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 18px;
  background: #f7faf7;
}

.result-box strong {
  color: var(--green-dark);
  font-size: 2rem;
}

.savings-list div {
  align-items: center;
}

.savings-list strong {
  color: var(--green-dark);
}

.goal-field {
  margin-top: 18px;
}

.goal-preview {
  margin-top: 14px;
  padding: 14px;
  background: #fff9ef;
  color: #60410f;
}

.mood-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.mood-row button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.mood-row button.active {
  border-color: var(--green);
  background: #e6f1eb;
  color: var(--green-dark);
}

.primary,
.secondary,
.icon-button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 16px;
  font-weight: 850;
}

.primary {
  background: var(--green);
  color: #fff;
}

.primary:hover {
  background: var(--green-dark);
}

.primary:disabled,
.secondary:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

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

.full {
  width: 100%;
}

.icon-button {
  width: 42px;
  padding: 0;
  background: #fff;
  border-color: var(--line);
  font-size: 1.4rem;
}

.profile-modal {
  width: min(680px, calc(100vw - 30px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
}

.profile-modal::backdrop {
  background: rgba(23, 33, 29, 0.45);
}

.modal-card {
  padding: 22px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.modal-actions {
  margin: 20px 0 0;
  padding: 0;
}

.install-layout {
  align-items: stretch;
  margin-bottom: 18px;
}

.install-hero {
  display: grid;
  align-content: center;
}

.install-hero h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1;
}

.install-hero p {
  max-width: 640px;
  color: var(--muted);
}

.install-hero .primary {
  width: fit-content;
  min-width: 190px;
  margin-top: 8px;
}

.install-note {
  margin: 12px 0 0;
  font-size: 0.95rem;
}

.install-card {
  display: grid;
  place-items: center;
  min-height: 360px;
  padding: 24px;
  background: #ecf3ef;
}

.phone-preview {
  width: min(230px, 72vw);
  aspect-ratio: 9 / 18;
  border: 10px solid #13211b;
  border-radius: 34px;
  background: #13211b;
  box-shadow: var(--shadow);
  padding: 12px;
}

.phone-speaker {
  width: 72px;
  height: 6px;
  margin: 0 auto 10px;
  border-radius: 999px;
  background: #394942;
}

.phone-screen {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  height: calc(100% - 16px);
  border-radius: 22px;
  background:
    linear-gradient(150deg, rgba(31, 138, 100, 0.16), rgba(40, 106, 150, 0.12)),
    #f8fbf8;
  text-align: center;
}

.mini-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--green);
  color: #fff;
  font-size: 1.8rem;
  font-weight: 900;
}

.phone-screen span {
  color: var(--muted);
  font-size: 0.86rem;
}

.step-list {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding-left: 22px;
}

.step-list li {
  padding-left: 4px;
}

@media (max-width: 1050px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .nav-item {
    justify-content: center;
    padding: 0 8px;
  }

  .subscription-panel {
    margin-top: 0;
  }

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

@media (max-width: 760px) {
  .app-shell {
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }

  .main-area,
  .sidebar {
    padding: 14px;
  }

  .sidebar {
    gap: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand span {
    font-size: 0.86rem;
  }

  .subscription-panel {
    grid-template-columns: 12px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 12px;
  }

  .subscription-panel .secondary {
    grid-column: 1 / -1;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: row;
    margin-bottom: 16px;
  }

  .topbar .primary {
    min-width: 112px;
    padding: 0 12px;
  }

  h1 {
    font-size: 2rem;
  }

  .nav-list,
  .metric-grid,
  .content-row,
  .calculator-grid,
  .journal-layout,
  .admin-layout,
  .install-layout,
  .install-steps,
  .lesson-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .nav-list {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0;
    padding: 8px max(8px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -10px 30px rgba(25, 43, 37, 0.1);
    backdrop-filter: blur(14px);
  }

  .nav-item {
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-height: 58px;
    padding: 4px 2px;
    font-size: 0.7rem;
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
  }

  .icon {
    width: 22px;
    height: 22px;
    font-size: 1rem;
  }

  .hero-band {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 20px;
  }

  .hero-band h2 {
    font-size: 2rem;
  }

  .hero-band p {
    font-size: 1rem;
  }

  .breath-card {
    min-height: 170px;
  }

  .metric {
    min-height: 96px;
  }

  .metric strong {
    font-size: 1.55rem;
  }

  .lesson-card {
    min-height: 210px;
  }

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

  .install-hero .primary {
    width: 100%;
  }

  .install-card {
    min-height: 300px;
  }

  .profile-modal {
    width: min(100vw - 18px, 680px);
  }

  .modal-card {
    max-height: calc(100vh - 28px);
    overflow: auto;
    padding: 18px;
  }

  .modal-actions {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding-top: 12px;
  }

  .wide {
    grid-column: auto;
  }
}

@media (max-width: 390px) {
  .nav-item {
    font-size: 0.64rem;
  }

  .topbar {
    flex-direction: column;
  }

  .topbar .primary {
    width: 100%;
  }
}
