:root {
  --bg: #fff7f9;
  --ink: #3a2430;
  --muted: #8a6574;
  --line: #f3d4df;
  --soft: #ffe8f0;
  --rose: #e86b8f;
  --rose-deep: #b83d63;
  --white: #ffffff;
  --ok-bg: #e9f7ef;
  --ok: #2f7a52;
  --wait-bg: #fff7e8;
  --wait: #8a6412;
  --bad-bg: #ffe8ec;
  --bad: #a63a4a;
  --shadow: 0 18px 44px rgba(184, 61, 99, 0.12);
  --radius: 22px;
  --pad: clamp(16px, 4vw, 40px);
  --max: 1120px;
  color: var(--ink);
  font-family: "Nunito", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(ellipse 80% 50% at 8% -8%, #ffd6e4, transparent 52%),
    radial-gradient(ellipse 55% 40% at 100% 0%, #ffeef5, transparent 48%),
    radial-gradient(ellipse 40% 30% at 70% 100%, #fff0f5, transparent 55%),
    var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

h1,
h2,
h3,
.brand-name,
.hero-brand,
.auth-title {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px var(--pad);
  background: rgba(255, 246, 248, 0.88);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.brand-mark-img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: block;
  flex-shrink: 0;
  box-shadow: 0 1px 0 rgba(184, 61, 99, 0.12);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #ffd0df, #ffb3c9);
  flex-shrink: 0;
}

.brand-mark.tiny {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  font-size: 14px;
}

.brand-name {
  font-size: 1.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-nav {
  display: none;
  gap: 18px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.top-nav a:hover {
  color: var(--rose-deep);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.link-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--rose-deep);
  font-weight: 700;
  padding: 8px 6px;
  cursor: pointer;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  border: 0;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--rose), #f08aa8);
  color: #fff;
  box-shadow: 0 10px 24px rgba(232, 107, 143, 0.28);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-compact {
  min-height: 40px;
  padding: 0 14px;
  font-size: 0.92rem;
}

.btn-block {
  width: 100%;
}

.view:not(.is-active) {
  display: none;
}

.hero {
  position: relative;
  width: 100%;
  margin: 0;
  display: grid;
  align-items: center;
  gap: 18px;
  padding: clamp(28px, 6vw, 56px) var(--pad) clamp(36px, 7vw, 64px);
  overflow: hidden;
  isolation: isolate;
}

.hero-stage {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(120deg, rgba(255, 214, 228, 0.55), transparent 42%),
    linear-gradient(200deg, rgba(255, 238, 245, 0.9), rgba(255, 247, 249, 0.2) 60%),
    repeating-linear-gradient(
      -18deg,
      transparent,
      transparent 18px,
      rgba(232, 107, 143, 0.035) 18px,
      rgba(232, 107, 143, 0.035) 19px
    );
  animation: stage-fade 1.1s ease both;
}

.hero-copy,
.hero-art {
  width: min(100%, var(--max));
  margin-inline: auto;
}

.hero-copy {
  max-width: 34rem;
  animation: rise 0.7s ease both;
  justify-self: start;
}

.hero-brand {
  margin: 0 0 8px;
  font-size: clamp(2rem, 5vw, 2.85rem);
  line-height: 1;
  color: var(--rose-deep);
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(1.45rem, 3.2vw, 2.05rem);
  line-height: 1.18;
  font-weight: 600;
  max-width: 22ch;
}

.hero-text {
  margin: 0 0 20px;
  max-width: 40ch;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-art {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
  animation: rise 0.85s ease 0.06s both;
}

.hero-illustration {
  width: min(100%, 460px);
  height: auto;
  max-height: 360px;
  filter: drop-shadow(0 18px 36px rgba(184, 61, 99, 0.12));
}

.hero-float-a {
  transform-origin: 50%;
  animation: bob 5.5s ease-in-out infinite;
}

.hero-float-b {
  transform-origin: 50%;
  animation: bob 4.2s ease-in-out 0.6s infinite;
}

.block {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 28px var(--pad) 36px;
}

.block.soft {
  width: 100%;
  max-width: none;
  background: linear-gradient(180deg, transparent, rgba(255, 232, 240, 0.55), transparent);
}

.block.soft > * {
  width: min(100%, var(--max));
  margin-left: auto;
  margin-right: auto;
}

.block-head {
  margin-bottom: 16px;
  max-width: 40rem;
}

.block-head h2 {
  margin: 0 0 6px;
  font-size: clamp(1.45rem, 2.8vw, 1.9rem);
}

.block-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.split {
  display: grid;
  gap: 18px;
}

.split-item {
  padding: 4px 0 8px;
  border-top: 2px solid #ffd0df;
}

.split-item h3 {
  margin: 14px 0 6px;
  font-size: 1.25rem;
}

.split-item p {
  margin: 0;
  color: var(--muted);
  max-width: 42ch;
}

.benefits {
  display: grid;
  gap: 22px 28px;
}

.benefit {
  padding: 2px 0 4px;
  border-top: 2px solid #ffd0df;
}

.benefit h3 {
  margin: 12px 0 6px;
  font-size: 1.12rem;
  line-height: 1.25;
}

.benefit p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
  max-width: 46ch;
}

.flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  counter-reset: step;
}

.flow li {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 4px 0 4px 52px;
  counter-increment: step;
}

.flow li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--rose), #f08aa8);
  color: #fff;
  font-weight: 800;
}

.flow strong {
  font-size: 1.05rem;
}

.flow span {
  color: var(--muted);
}

.flow-cta {
  margin-top: 18px;
}

.auth-shell {
  width: min(100%, 920px);
  margin: 0 auto;
  padding: 24px var(--pad) 40px;
  display: grid;
  gap: 20px;
  align-items: center;
}

.auth-side {
  display: none;
  justify-items: center;
  text-align: center;
  gap: 8px;
}

.auth-side .profile-cat-svg {
  width: min(100%, 280px);
  height: auto;
}

.auth-meow {
  margin: 0;
  color: var(--rose-deep);
  font-size: 1.2rem;
}

.auth-side-text {
  margin: 0;
  color: var(--muted);
  max-width: 22ch;
}

.auth-card {
  width: min(100%, 440px);
  margin: 0 auto;
}

.back-link {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--rose-deep);
  font-weight: 700;
  font-size: 0.92rem;
}

.auth-title {
  margin: 0 0 6px;
  font-size: clamp(1.8rem, 4vw, 2.2rem);
}

.auth-sub {
  margin: 0 0 18px;
  color: var(--muted);
}

.cabinet-shell {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: clamp(20px, 5vw, 40px) var(--pad) 64px;
  display: grid;
  gap: 18px;
}

.cabinet-hero {
  display: grid;
  gap: 12px;
  align-items: center;
}

.cabinet-cat {
  display: none;
}

.cabinet-cat .profile-cat-svg {
  width: min(100%, 220px);
  height: auto;
  margin-left: auto;
}

.cat-badge {
  margin: 0 0 6px;
  color: var(--rose-deep);
  font-size: 1.1rem;
}

.cabinet-lede {
  margin: 10px 0 0;
  color: var(--muted);
}

.cabinet-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: clamp(18px, 4vw, 28px);
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 18px;
  padding: 4px;
  border-radius: 999px;
  background: var(--soft);
}

.tab {
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.tab.active {
  background: var(--white);
  color: var(--rose-deep);
  box-shadow: 0 4px 14px rgba(184, 61, 99, 0.1);
}

.form {
  display: grid;
  gap: 12px;
}

.form-intro h3 {
  margin: 0 0 6px;
  font-size: 1.25rem;
}

.form-intro p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.95rem;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid #e8b8c8;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  padding: 12px 14px;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input:focus,
textarea:focus {
  outline: 3px solid rgba(232, 107, 143, 0.18);
  border-color: var(--rose);
}

.form-msg {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.92rem;
}

.form-msg.error {
  background: var(--bad-bg);
  color: var(--bad);
}

.form-msg.ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.session-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.session-mail {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  word-break: break-word;
}

.notice {
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 14px;
  margin-bottom: 14px;
}

.notice.ok {
  background: var(--ok-bg);
  border-color: #c8e8d4;
}

.notice.pending {
  background: var(--wait-bg);
  border-color: #f0d29a;
}

.notice.rejected {
  background: var(--bad-bg);
  border-color: #f0c6c6;
}

.notice h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.notice p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.key-box {
  margin: 10px 0;
  padding: 12px;
  border-radius: 12px;
  background: #2f1d26;
  color: #ffe8f0;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.85rem;
  word-break: break-all;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
}

.install-box {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

.install-box p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.muted {
  color: var(--muted);
}

.onboard-box {
  margin-top: 20px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(165deg, #fff 0%, #fff7f9 100%);
  display: grid;
  gap: 16px;
}

.onboard-head {
  display: grid;
  gap: 12px;
}

.onboard-eyebrow {
  margin: 0 0 4px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rose-deep);
}

.onboard-head h3 {
  margin: 0 0 4px;
  font-size: 1.25rem;
}

.onboard-head .muted {
  margin: 0;
  font-size: 0.92rem;
}

.onboard-progress {
  display: grid;
  gap: 6px;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--rose-deep);
}

.onboard-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--soft);
  overflow: hidden;
}

.onboard-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rose), #f08aa8);
  transition: width 0.35s ease;
}

.onboard-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.onboard-step {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid transparent;
  transition: border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.onboard-step.is-current {
  border-color: #f0b8c8;
  background: rgba(255, 232, 240, 0.45);
}

.onboard-step.is-done {
  opacity: 0.85;
}

.onboard-step.is-locked {
  opacity: 0.45;
}

.onboard-step-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: var(--soft);
  color: var(--rose-deep);
}

.onboard-step.is-done .onboard-step-mark {
  background: var(--ok-bg);
  color: var(--ok);
}

.onboard-step.is-current .onboard-step-mark {
  background: linear-gradient(135deg, var(--rose), #f08aa8);
  color: #fff;
}

.onboard-step-body strong {
  display: block;
  margin-bottom: 2px;
}

.onboard-step-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.onboard-step-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.onboard-done-label {
  margin: 6px 0 0 !important;
  font-size: 0.8rem !important;
  font-weight: 800;
  color: var(--ok) !important;
}

#session-panel.is-loading {
  opacity: 0.72;
  pointer-events: none;
}

.top-cabinet {
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.footer {
  padding: 20px var(--pad) 32px;
  color: var(--muted);
  display: grid;
  gap: 4px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.footer p {
  margin: 0;
}

.footer-meta {
  font-size: 0.85rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes stage-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (min-width: 720px) {
  .top-nav {
    display: flex;
    flex: 0 1 auto;
  }

  .brand {
    flex: 0 1 auto;
  }

  .hero {
    grid-template-columns:
      1fr
      minmax(0, 560px)
      minmax(0, 480px)
      1fr;
    column-gap: 36px;
    align-items: center;
    min-height: min(72vh, 640px);
    padding: 40px var(--pad) 48px;
  }

  .hero-stage {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .hero-copy,
  .hero-art {
    width: auto;
    margin: 0;
    max-width: none;
    grid-row: 1;
  }

  .hero-copy {
    grid-column: 2;
  }

  .hero-art {
    grid-column: 3;
  }

  .onboard-head {
    grid-template-columns: 1fr auto;
    align-items: end;
  }

  .split {
    grid-template-columns: 1fr 1fr;
    gap: 24px 32px;
  }

  .benefits {
    grid-template-columns: 1fr 1fr;
    gap: 28px 36px;
  }

  .flow {
    grid-template-columns: 1fr 1fr;
    gap: 14px 24px;
  }

  .auth-shell {
    grid-template-columns: 0.9fr 1.1fr;
  }

  .auth-side {
    display: grid;
  }

  .auth-card {
    margin: 0;
  }

  .cabinet-hero {
    grid-template-columns: 1.2fr 0.8fr;
  }

  .cabinet-cat {
    display: block;
  }
}

@media (min-width: 980px) {
  .benefits {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (max-width: 719px) {
  .topbar {
    padding: 8px 12px;
    gap: 8px;
  }

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

  .brand-name {
    font-size: 0.92rem;
    max-width: min(46vw, 9.5rem);
  }

  .top-login {
    display: none;
  }

  .top-register,
  #top-logout {
    min-height: 34px;
    padding: 0 12px;
    font-size: 0.82rem;
  }

  .top-cabinet {
    max-width: 8rem;
    font-size: 0.85rem;
  }

  .hero {
    padding: 16px 12px 28px;
    gap: 12px;
    min-height: 0;
  }

  .hero-art {
    order: -1;
  }

  .hero-illustration {
    max-height: 220px;
    width: min(100%, 320px);
  }

  .hero-brand {
    font-size: clamp(1.7rem, 8vw, 2.2rem);
  }

  .hero-cta .btn {
    width: 100%;
    min-height: 44px;
  }

  .block {
    padding: 22px 12px 28px;
  }

  .cabinet-shell,
  .auth-shell {
    padding: 16px 12px 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
