body {
  user-select: none;
}

body.home-page {
  overflow-y: hidden;
}

.landing-page {
  width: min(var(--content), calc(100% - 32px));
  margin: 114px auto 0;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  padding: clamp(28px, 4vw, 54px);
  min-height: clamp(180px, calc(100vh - 590px), 330px);
  background:
    linear-gradient(135deg, rgba(72, 229, 213, 0.11), transparent 36%),
    linear-gradient(160deg, rgba(17, 39, 75, 0.84), rgba(12, 31, 63, 0.78));
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  position: relative;
}

.auth-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
  color: #d8e6fb;
  background: linear-gradient(
    180deg,
    rgba(47, 74, 118, 0.92),
    rgba(28, 49, 84, 0.9)
  );
  border: 1px solid rgba(157, 190, 232, 0.2);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(12, 32, 58, 0.22);
}

.auth-panel__header {
  display: grid;
  gap: 6px;
}

.auth-panel__status {
  margin: 0;
  color: #f2f7ff;
  font-size: 1.02rem;
  font-weight: 780;
  line-height: 1.3;
  min-height: 0;
}

.auth-panel__helper {
  margin: 0;
  color: #a7bad5;
  font-size: 0.87rem;
  line-height: 1.45;
}

.auth-panel__chooser {
  display: grid;
  gap: 10px;
}

.auth-panel__signed-in {
  display: grid;
  gap: 12px;
}

.auth-panel__settings {
  display: grid;
  gap: 12px;
}

.auth-panel__form {
  display: grid;
  gap: 12px;
}

.auth-panel__settings-form {
  padding: 0.2rem 0 0;
}

.auth-panel__field {
  display: grid;
  gap: 6px;
}

.auth-panel__hint {
  margin: -2px 0 0;
  color: #91a8c7;
  font-size: 0.78rem;
  line-height: 1.4;
}

.auth-panel__feedback {
  margin: 0;
  padding: 0.72rem 0.84rem;
  border: 1px solid rgba(157, 190, 232, 0.2);
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.45;
}

.auth-panel__feedback--error {
  color: #ffd0d5;
  background: rgba(255, 107, 122, 0.12);
  border-color: rgba(255, 107, 122, 0.24);
}

.auth-panel__feedback--success {
  color: #c8f7df;
  background: rgba(51, 223, 157, 0.12);
  border-color: rgba(51, 223, 157, 0.24);
}

.auth-panel__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 2px;
}

.auth-panel__utility {
  justify-self: start;
  padding: 0;
  color: var(--auth-accent-text, #ff9aa5);
  background: transparent;
  border: 0;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: color-mix(
    in srgb,
    var(--auth-accent-text, #ff9aa5),
    transparent 38%
  );
  text-underline-offset: 0.16em;
  cursor: pointer;
}

.auth-panel__utility:hover {
  color: #ffffff;
}

.auth-panel__utility:disabled {
  opacity: 0.55;
  cursor: default;
}

.auth-choice {
  width: 100%;
  justify-content: center;
}

.auth-profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0.72rem 0.84rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(157, 190, 232, 0.12);
  border-radius: 12px;
}

.auth-profile-label {
  color: #9eb4d2;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-profile-value {
  color: #eef5ff;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: right;
}

.auth-profile-value--accent {
  color: var(--auth-accent-text, #ff9aa5);
}

.auth-panel__tools {
  display: grid;
  gap: 8px;
}

.auth-tool-button {
  width: 100%;
  justify-content: center;
}

.auth-panel .small-label {
  margin-bottom: 0;
  color: #bdd0ea;
  font-size: 0.76rem;
}

.auth-panel .glass-input {
  min-height: 40px;
  color: #eaf2ff;
  background: rgba(16, 31, 58, 0.66);
  border-color: rgba(157, 190, 232, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.auth-panel .glass-input::placeholder {
  color: #87a0bf;
}

.auth-panel .glass-input:focus {
  color: #f2f7ff;
  background: rgba(18, 35, 64, 0.9);
  border-color: rgba(72, 229, 213, 0.78);
  box-shadow:
    0 0 0 4px rgba(72, 229, 213, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.eyebrow--alert {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.auth-alert-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--auth-dot, #ff5f6d);
  box-shadow:
    0 0 0 4px var(--auth-dot-ring, rgba(255, 95, 109, 0.16)),
    0 0 14px var(--auth-dot-glow, rgba(255, 95, 109, 0.82));
  animation: auth-dot-pulse 2.4s ease-in-out infinite;
}

#accountPopup[data-auth-state="signed-out"] {
  --auth-accent-text: #ff9aa5;
  --auth-accent-bg: rgba(255, 107, 122, 0.12);
  --auth-accent-border: rgba(255, 107, 122, 0.24);
  --auth-accent-shadow: rgba(255, 107, 122, 0.14);
  --auth-dot: #ff5f6d;
  --auth-dot-ring: rgba(255, 95, 109, 0.16);
  --auth-dot-glow: rgba(255, 95, 109, 0.82);
}

#accountPopup[data-auth-state="signed-in"] {
  --auth-accent-text: #8ff0b6;
  --auth-accent-bg: rgba(51, 223, 157, 0.12);
  --auth-accent-border: rgba(51, 223, 157, 0.24);
  --auth-accent-shadow: rgba(51, 223, 157, 0.14);
  --auth-dot: #33df9d;
  --auth-dot-ring: rgba(51, 223, 157, 0.16);
  --auth-dot-glow: rgba(51, 223, 157, 0.82);
}

#accountPopup .eyebrow--light {
  color: var(--auth-accent-text, #ff9aa5);
  background: var(--auth-accent-bg, rgba(255, 107, 122, 0.12));
  border-color: var(--auth-accent-border, rgba(255, 107, 122, 0.24));
}

#accountPopup .auth-choice.is-selected {
  color: var(--auth-accent-text, #ff9aa5);
  border-color: var(--auth-accent-border, rgba(255, 107, 122, 0.42));
  box-shadow: 0 0 0 3px var(--auth-accent-shadow, rgba(255, 107, 122, 0.12));
}

@keyframes auth-dot-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
    box-shadow:
      0 0 0 4px var(--auth-dot-ring, rgba(255, 95, 109, 0.16)),
      0 0 14px var(--auth-dot-glow, rgba(255, 95, 109, 0.82));
  }

  50% {
    opacity: 0.45;
    transform: scale(0.88);
    box-shadow:
      0 0 0 7px transparent,
      0 0 8px var(--auth-dot-glow, rgba(255, 95, 109, 0.5));
  }
}

.glass-button--light {
  color: #eaf8ff;
  background: linear-gradient(
    180deg,
    rgba(72, 229, 213, 0.16),
    rgba(90, 168, 255, 0.14)
  );
  border-color: rgba(90, 168, 255, 0.24);
}

.glass-button--light:hover {
  color: #ffffff;
  background: linear-gradient(
    180deg,
    rgba(72, 229, 213, 0.22),
    rgba(90, 168, 255, 0.2)
  );
  border-color: rgba(90, 168, 255, 0.34);
}

.glass-button--subtle {
  color: #d0def3;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(157, 190, 232, 0.18);
}

.glass-button--subtle:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(90, 168, 255, 0.26);
}

.eyebrow {
  width: fit-content;
  margin: 0 0 16px;
  padding: 0.32rem 0.58rem;
  color: var(--brand);
  background: rgba(72, 229, 213, 0.12);
  border: 1px solid rgba(72, 229, 213, 0.24);
  border-radius: var(--radius-xs);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-copy h2 {
  max-width: 760px;
  margin: 0;
  color: var(--ink-strong);
  font-size: clamp(2.3rem, 1.7rem + 3vw, 5.4rem);
  font-weight: 800;
  line-height: 0.94;
}

.hero-copy p:not(.eyebrow) {
  max-width: 620px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.06rem;
}

.hero-accent {
  color: var(--ink-strong);
}

.hero-accent--mint {
  color: color-mix(in srgb, var(--mint), white 28%);
}

.hero-accent--blue {
  color: color-mix(in srgb, var(--blue), white 22%);
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.app-card {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  min-height: clamp(150px, 24vh, 220px);
  padding: 30px 24px;
  overflow: hidden;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  isolation: isolate;
  transform: translateY(0) scale(1);
  transition:
    transform 0.34s cubic-bezier(0.2, 0.9, 0.2, 1.18),
    border-color 0.24s ease,
    box-shadow 0.24s ease,
    background-color 0.24s ease;
}

.app-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 72%);
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.045);
  opacity: 0.54;
  z-index: 2;
  pointer-events: none;
  transition:
    border-color 0.24s ease,
    box-shadow 0.24s ease,
    opacity 0.24s ease;
}

.app-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent), transparent 40%),
    0 0 32px color-mix(in srgb, var(--accent), transparent 62%),
    inset 0 0 22px color-mix(in srgb, var(--accent), transparent 76%);
  opacity: 0;
  transition: opacity 0.28s ease;
  pointer-events: none;
}

.app-card:hover,
.app-card:focus-visible {
  border-color: color-mix(in srgb, var(--accent), white 10%);
  box-shadow:
    0 26px 72px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transform: translateY(-8px) scale(1.018);
}

.app-card:hover::before,
.app-card:focus-visible::before {
  border-color: color-mix(in srgb, var(--accent), transparent 30%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 0 26px color-mix(in srgb, var(--accent), transparent 86%);
  opacity: 1;
}

.app-card:hover::after,
.app-card:focus-visible::after {
  opacity: 1;
}

.app-card--optml {
  --accent: var(--violet);
}

.app-card--runsheet {
  --accent: var(--blue);
}

.app-card--swift {
  --accent: var(--mint);
}

.app-card--uxrx {
  --accent: var(--amber);
}

.card-icon {
  display: grid;
  place-items: center;
  color: color-mix(in srgb, var(--accent), white 32%);
  font-size: clamp(3.7rem, 2.8rem + 2.8vw, 5.3rem);
  line-height: 1;
}

.card-label {
  margin-top: 8px;
  color: rgba(234, 242, 255, 0.9);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
}

.app-card p {
  max-width: 230px;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  text-align: center;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-copy {
    animation: hero-enter 0.7s ease both;
  }

  .app-card {
    animation: card-enter 0.58s ease both;
  }

  .app-card:nth-child(2) {
    animation-delay: 0.07s;
  }

  .app-card:nth-child(3) {
    animation-delay: 0.14s;
  }
}

@keyframes hero-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 900px) {
  .landing-page {
    margin-bottom: 32px;
  }

  .landing-hero {
    grid-template-columns: 1fr;
  }

  .app-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .landing-page {
    width: min(100% - 24px, var(--content));
  }

  .hero-copy {
    padding: 24px;
  }

  .auth-panel__actions {
    grid-template-columns: 1fr;
  }
}
