.app-body {
  min-height: 100dvh;
}

.app-shell {
  width: min(1120px, calc(100% - 48px));
  min-height: 100dvh;
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: 56px 0;
}

.auth-panel,
.family-panel {
  width: 100%;
}

.auth-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(340px, 0.96fr);
  gap: clamp(48px, 8vw, 128px);
  align-items: end;
  padding: clamp(32px, 6vw, 72px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-muted) 100%);
  box-shadow: 0 24px 56px rgba(16, 42, 59, 0.1);
}

.auth-panel > .brand {
  grid-column: 1 / -1;
}

.auth-copy h1,
.family-intro h1 {
  max-width: 12ch;
  margin-bottom: 20px;
  font-size: clamp(42px, 5.3vw, 68px);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.auth-copy > p:last-child,
.family-intro > p:last-child,
.memory-home-heading > p:last-child {
  max-width: 40ch;
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 17px;
}

.auth-form,
.family-form {
  display: grid;
  gap: 20px;
  padding: 28px;
  border-radius: 14px;
  background: var(--surface);
}

.form-field {
  display: grid;
  gap: 8px;
}

.form-field label {
  font-size: 14px;
  font-weight: 700;
}

.form-field input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.form-field input:focus {
  outline: 3px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-color: var(--accent);
}

.form-field input::placeholder {
  color: var(--ink-soft);
  opacity: 0.8;
}

.form-note,
.field-help {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.form-message {
  min-height: 1.5em;
  margin: 0;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 600;
}

.form-message.is-error {
  color: #a42424;
}

.button[disabled],
.text-button[disabled] {
  cursor: not-allowed;
  opacity: 0.56;
}

.family-panel {
  padding: 0 0 64px;
}

.app-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.text-button:hover {
  color: var(--accent);
}

.family-intro {
  padding: 88px 0 48px;
}

.family-form {
  width: min(480px, 100%);
  border: 1px solid var(--line);
}

.memory-home {
  padding-top: 20px;
}

.memory-home-heading {
  padding: 52px 0 32px;
  border-top: 1px solid var(--line);
}

.memory-home h2 {
  margin-bottom: 16px;
}

.starter-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--line);
}

.starter-action {
  min-height: 180px;
  padding: 28px;
  border: 0;
  background: var(--surface-muted);
  color: var(--ink);
  text-align: left;
  font: inherit;
}

.starter-action span,
.starter-action small {
  display: block;
  color: var(--ink-soft);
  font-size: 13px;
}

.starter-action strong {
  display: block;
  margin: 24px 0 8px;
  font-size: 21px;
  letter-spacing: -0.03em;
}

@media (max-width: 767px) {
  .app-shell {
    width: min(100% - 32px, 1120px);
    padding: 16px 0;
  }

  .auth-panel {
    grid-template-columns: 1fr;
    gap: 44px;
    padding: 28px;
  }

  .family-intro {
    padding: 64px 0 40px;
  }

  .starter-actions {
    grid-template-columns: 1fr;
  }
}
