:root {
  --brand-blue: #1554d1;
  --brand-blue-dark: #0d2d68;
  --aqua: #62e2d4;
  --ink: #122033;
  --muted: #66758a;
  --surface: #ffffff;
  --line: #d9e3ef;
  --warm: #e8a84f;
  --recovery: #2a9d8f;
  --breath-scale: 0.72;
  --session-progress: 0%;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, #f8fbff 0%, #eff8f5 54%, #f8f2e8 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

body[data-access="locked"] .app-shell,
body[data-access="unlocked"] .signup-screen {
  display: none;
}

.signup-screen {
  min-height: 100vh;
  padding: 28px 16px;
  display: grid;
  place-items: center;
}

.signup-card {
  width: min(100%, 460px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 50px rgba(34, 59, 95, 0.12);
}

.signup-logo {
  display: block;
  width: 150px;
  height: auto;
  margin-bottom: 18px;
}

.signup-intro,
.supporting-text {
  color: var(--muted);
  line-height: 1.55;
}

.signup-intro {
  margin: 12px 0 22px;
}

.lead-form,
.field-group {
  display: grid;
  gap: 14px;
}

.field-group {
  gap: 7px;
}

.field-group label,
.consent-group label {
  color: var(--brand-blue-dark);
  font-weight: 780;
}

.field-group input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
}

.field-group.has-error input {
  border-color: #a33838;
}

.consent-group {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.consent-group input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--brand-blue);
}

.field-error,
.form-status {
  min-height: 20px;
  margin: 0;
  color: #a33838;
  font-size: 0.9rem;
  font-weight: 720;
}

.form-status {
  min-height: 22px;
}

.form-status.is-success {
  color: #156d61;
}

.supporting-text {
  margin: -6px 0 0;
  font-size: 0.92rem;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0 4px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.brand-logo {
  width: clamp(112px, 16vw, 170px);
  height: auto;
  flex: 0 0 auto;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 4.2rem);
}

h2 {
  font-size: clamp(1.45rem, 2.5vw, 2.5rem);
}

.state-pill {
  min-width: 96px;
  padding: 10px 14px;
  border: 1px solid rgba(21, 84, 209, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--brand-blue-dark);
  font-size: 0.9rem;
  font-weight: 760;
  text-align: center;
}

.practice-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 410px;
  gap: 20px;
}

.practice-stage,
.control-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 18px 50px rgba(34, 59, 95, 0.1);
}

.practice-stage {
  min-height: 700px;
  padding: clamp(22px, 4vw, 44px);
  display: grid;
  grid-template-rows: auto minmax(320px, 1fr) auto auto auto;
  gap: 22px;
}

.stage-copy {
  max-width: 680px;
}

.stage-copy p:last-child {
  max-width: 62ch;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.55;
}

.visual-zone {
  min-height: 320px;
  display: grid;
  place-items: center;
}

.progress-shell {
  width: min(58vw, 380px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    conic-gradient(var(--brand-blue) var(--session-progress), rgba(21, 84, 209, 0.12) 0),
    radial-gradient(circle, #ffffff 60%, transparent 61%);
  transition: background 180ms linear;
}

.breath-circle {
  width: 72%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  transform: scale(var(--breath-scale));
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.86), transparent 30%),
    linear-gradient(145deg, var(--aqua), var(--brand-blue) 62%, var(--warm));
  color: #ffffff;
  box-shadow:
    0 24px 70px rgba(21, 84, 209, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  will-change: transform;
}

.breath-circle span {
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 760;
}

.breath-circle strong {
  font-size: clamp(2.3rem, 6vw, 5rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.breath-cue {
  min-height: 34px;
  margin: 0;
  color: var(--brand-blue-dark);
  font-size: clamp(1rem, 1.7vw, 1.3rem);
  font-weight: 720;
  line-height: 1.35;
  text-align: center;
}

.metrics-row,
.detail-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.detail-panel {
  grid-template-columns: 1fr;
}

.metrics-row div,
.detail-panel div {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.85);
}

.metrics-row span,
.detail-panel span,
.completion-panel span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

.metrics-row strong,
.detail-panel strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.35;
}

.completion-panel {
  padding: 16px 18px;
  border: 1px solid rgba(42, 157, 143, 0.28);
  border-left: 5px solid var(--recovery);
  border-radius: 8px;
  background: rgba(235, 250, 247, 0.95);
}

.completion-panel strong {
  display: block;
  color: #14554d;
  font-size: 1.08rem;
  line-height: 1.4;
}

.control-panel {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section-heading {
  display: grid;
  gap: 2px;
}

.routine-grid,
.session-controls {
  display: grid;
  gap: 10px;
}

.routine-card,
.session-option,
.primary-action,
.secondary-action {
  border-radius: 8px;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.routine-card {
  width: 100%;
  padding: 14px 15px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.routine-card span,
.routine-card small {
  display: block;
}

.routine-card span {
  font-weight: 800;
  line-height: 1.25;
}

.routine-card small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.routine-card:hover,
.session-option:hover,
.secondary-action:hover {
  transform: translateY(-1px);
  border-color: rgba(21, 84, 209, 0.46);
}

.routine-card.is-selected,
.session-option.is-selected {
  border-color: var(--brand-blue);
  background: #eef5ff;
  box-shadow: inset 0 0 0 1px rgba(21, 84, 209, 0.2);
}

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

.session-option {
  min-height: 46px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
}

.modify-toggle {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--brand-blue-dark);
  font-weight: 780;
}

.modify-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-blue);
}

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

.primary-action,
.secondary-action {
  min-height: 54px;
  border: 1px solid transparent;
  font-weight: 820;
}

.primary-action {
  background: var(--brand-blue);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(21, 84, 209, 0.25);
}

.primary-action:hover {
  transform: translateY(-1px);
  background: #0f46b7;
}

.secondary-action {
  border-color: var(--line);
  background: #ffffff;
  color: var(--brand-blue-dark);
}

.contact-footer {
  padding: 0 0 18px;
}

.contact-footer address {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 18px;
  color: var(--muted);
  font-size: 0.95rem;
  font-style: normal;
}

.contact-footer strong {
  color: var(--brand-blue-dark);
}

.contact-footer a {
  color: var(--brand-blue);
  font-weight: 720;
  text-decoration: none;
}

.contact-footer a:hover {
  text-decoration: underline;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(232, 168, 79, 0.75);
  outline-offset: 3px;
}

@media (max-width: 960px) {
  .practice-layout {
    grid-template-columns: 1fr;
  }

  .practice-stage {
    min-height: auto;
  }

  .control-panel {
    order: -1;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding: 12px 0;
  }

  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-lockup {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .brand-logo {
    width: 132px;
  }

  .state-pill {
    align-self: stretch;
  }

  .practice-stage,
  .control-panel {
    padding: 18px;
  }

  .visual-zone {
    min-height: 270px;
  }

  .progress-shell {
    width: min(78vw, 310px);
  }

  .metrics-row,
  .session-options,
  .actions {
    grid-template-columns: 1fr;
  }

  .contact-footer address {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
