:root {
  --bg: #0a2540;
  --deep: #061a2f;
  --cyan: #00b8e6;
  --turq: #18d6b4;
  --gold: #d8b763;
  --text: #f5fbff;
  --muted: #c2d7e8;
  --line: rgba(255,255,255,.16);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #071f37;
}

.shell {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.welcome {
  width: min(100%, 460px);
  text-align: center;
  animation: enter .45s ease both;
}

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

.logo {
  width: 136px;
  height: 136px;
  object-fit: cover;
  border: 8px solid #fff;
  border-radius: 28px;
  box-shadow: 0 24px 70px rgba(0,0,0,.28);
  background: #fff;
}

.eyebrow {
  margin: 24px 0 8px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
}

.lead {
  margin: 12px 0 0;
  color: #e5f7ff;
  font-size: 16px;
  font-weight: 700;
}

.copy {
  margin: 14px auto 0;
  max-width: 36ch;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.actions {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

button, a, .link-button, .primary, .secondary, .ghost {
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.primary {
  background: var(--turq);
  color: #052033;
}

.secondary {
  background: rgba(255,255,255,.12);
  border: 1px solid var(--line);
  color: #fff;
}

.ghost {
  background: transparent;
  color: #d7ecf8;
  border: 1px solid rgba(255,255,255,.12);
}

.safe {
  margin: 22px auto 0;
  max-width: 34ch;
  color: rgba(245,251,255,.72);
  font-size: 12px;
  line-height: 1.45;
}

.access-panel {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  text-align: left;
}

.access-panel strong,
.access-panel span,
.access-panel label {
  display: block;
}

.access-panel span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.access-panel label {
  margin-top: 14px;
  color: #e8f6ff;
  font-size: 12px;
  font-weight: 800;
}

.access-panel input {
  width: 100%;
  min-height: 46px;
  margin-top: 7px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 10px;
  padding: 0 12px;
  color: #fff;
  background: rgba(0,0,0,.2);
  font: inherit;
}

.access-panel input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(24,214,180,.5);
  outline-offset: 3px;
}

.access-panel input[aria-invalid="true"] {
  border-color: #ff9b9b;
}

.small-actions {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.form-message {
  min-height: 18px;
  margin: 10px 0 0;
  color: #f4e8bf;
  font-size: 12px;
  line-height: 1.35;
}

.ios-help {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(216,183,99,.38);
  border-radius: 8px;
  background: rgba(216,183,99,.1);
  text-align: left;
}

.ios-help strong,
.ios-help span {
  display: block;
}

.tutorial-reopen {
  min-height: 42px;
  margin-top: 12px;
  padding: 0;
  color: var(--gold);
  background: transparent;
  text-decoration: underline;
}

.install-tutorial {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  align-items: end;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.tutorial-scrim {
  position: fixed;
  inset: 0;
  background: rgba(2, 12, 23, .82);
  backdrop-filter: blur(6px);
}

.tutorial-card {
  position: relative;
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 20px 20px calc(20px + var(--safe-bottom));
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 24px 24px 0 0;
  color: var(--text);
  background: #09223b;
  box-shadow: 0 -24px 80px rgba(0,0,0,.42);
  text-align: center;
  animation: tutorial-up .25s ease both;
}

@keyframes tutorial-up {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

.tutorial-progress {
  display: flex;
  gap: 7px;
  justify-content: center;
  margin-bottom: 14px;
}

.tutorial-progress span {
  width: 26px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  transition: background .2s ease;
}

.tutorial-progress span.active {
  background: var(--turq);
}

.tutorial-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(255,255,255,.1);
  font-size: 26px;
  line-height: 1;
}

.tutorial-phone {
  position: relative;
  width: 210px;
  height: 250px;
  margin: 0 auto 14px;
  overflow: hidden;
  border: 5px solid #dce8ee;
  border-radius: 30px;
  background: #f4f8fa;
  box-shadow: 0 12px 40px rgba(0,0,0,.3);
}

.tutorial-phone::before {
  content: "";
  position: absolute;
  z-index: 6;
  top: 8px;
  left: 50%;
  width: 72px;
  height: 19px;
  border-radius: 999px;
  background: #102130;
  transform: translateX(-50%);
}

.tutorial-page-preview {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  height: 204px;
  color: #0a2540;
  font-size: 12px;
  font-weight: 800;
  background: linear-gradient(160deg, #edf8fb, #d8f2ed);
}

.tutorial-page-preview img {
  width: 52px;
  height: 52px;
  border-radius: 12px;
}

.safari-bar {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 0;
  left: 0;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  color: #1777c8;
  background: rgba(250,252,253,.97);
  border-top: 1px solid #ccd9df;
}

.safari-side { font-size: 12px; font-weight: 800; }

.share-symbol {
  width: 27px;
  height: 27px;
  border: 2px solid #1777c8;
  border-top: 0;
  border-radius: 4px;
  font-size: 24px;
  line-height: 18px;
}

.share-sheet,
.add-screen {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: none;
  color: #152735;
  background: #f4f6f8;
}

.share-sheet {
  top: 55px;
  padding: 12px 12px 0;
  border-radius: 20px 20px 0 0;
}

.share-sheet-handle {
  width: 36px;
  height: 4px;
  margin: 0 auto 16px;
  border-radius: 999px;
  background: #aeb8c0;
}

.share-sheet-title {
  padding-bottom: 18px;
  color: #536471;
  font-size: 12px;
}

.share-option {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 10px;
  border: 3px solid var(--turq);
  border-radius: 12px;
  background: #fff;
  text-align: left;
  font-size: 12px;
}

.home-plus {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 2px solid #152735;
  border-radius: 5px;
  font-size: 22px;
}

.add-screen {
  padding: 38px 14px 14px;
  text-align: left;
}

.add-screen > strong { font-size: 13px; }

.app-preview {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 28px;
  padding: 14px;
  border-radius: 14px;
  background: #fff;
  font-size: 13px;
  font-weight: 800;
}

.app-preview img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
}

.add-action {
  position: absolute;
  top: 35px;
  right: 14px;
  padding: 6px 8px;
  border: 3px solid var(--turq);
  border-radius: 9px;
  color: #0773d1;
  font-size: 12px;
  font-weight: 900;
}

.tutorial-arrow {
  position: absolute;
  z-index: 7;
  width: 38px;
  height: 38px;
  border-right: 6px solid var(--gold);
  border-bottom: 6px solid var(--gold);
  filter: drop-shadow(0 3px 2px rgba(0,0,0,.3));
  animation: point 1s ease-in-out infinite;
}

@keyframes point {
  0%, 100% { transform: translateY(-5px) rotate(45deg); }
  50% { transform: translateY(5px) rotate(45deg); }
}

.tutorial-phone[data-step="1"] .tutorial-arrow {
  right: 79px;
  bottom: 49px;
}

.tutorial-phone[data-step="2"] .share-sheet { display: block; }
.tutorial-phone[data-step="2"] .tutorial-arrow {
  right: 76px;
  top: 104px;
}

.tutorial-phone[data-step="3"] .add-screen { display: block; }
.tutorial-phone[data-step="3"] .tutorial-arrow {
  right: 43px;
  top: 58px;
  transform: rotate(225deg);
  animation-name: point-up;
}

@keyframes point-up {
  0%, 100% { transform: translateY(5px) rotate(225deg); }
  50% { transform: translateY(-5px) rotate(225deg); }
}

.tutorial-step-label {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.tutorial-card h2 {
  margin: 0;
  font-size: 22px;
}

.tutorial-card > p:not(.tutorial-step-label) {
  min-height: 42px;
  margin: 9px auto 16px;
  max-width: 38ch;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

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

.tutorial-actions .ghost[hidden] + .primary {
  grid-column: 1 / -1;
}

body.tutorial-open { overflow: hidden; }

.ios-help span {
  margin-top: 5px;
  color: #f4e8bf;
  font-size: 13px;
  line-height: 1.45;
}

.support {
  width: min(calc(100% - 32px), 430px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  color: var(--text);
  background: #09223b;
}

.support::backdrop {
  background: rgba(0,0,0,.58);
}

.support h2 {
  margin: 0;
  font-size: 24px;
}

.support p {
  margin: 12px 0 20px;
  color: var(--muted);
  line-height: 1.5;
}

.support .link-button {
  width: 100%;
  margin-top: 10px;
}

@media (max-width: 380px) {
  .shell { padding: 18px; }
  .logo { width: 116px; height: 116px; border-radius: 22px; }
  h1 { font-size: 26px; }
  .tutorial-phone { height: 220px; }
  .tutorial-page-preview { height: 174px; }
  .tutorial-card { padding-top: 15px; }
}

@media (min-width: 600px) {
  .install-tutorial { align-items: center; padding: 24px; }
  .tutorial-card { border-radius: 24px; }
}

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

@media (min-width: 760px) {
  .welcome {
    width: min(100%, 420px);
  }

  .logo {
    width: 118px;
    height: 118px;
    border-radius: 24px;
  }
}
