:root {
  --ink: #2c2140;
  --ink-soft: #4d3f64;
  --muted: #7b6c8d;
  --muted-2: #a493b1;
  --paper: #fffdfb;
  --pink: #ff5f9e;
  --pink-deep: #e93b80;
  --pink-soft: #ffd9e8;
  --purple: #8b6cf6;
  --purple-soft: #e9e2ff;
  --sky: #4fbdf6;
  --sky-soft: #d9f2ff;
  --yellow: #ffd166;
  --yellow-soft: #fff3c9;
  --mint: #2dd4bf;
  --mint-soft: #d9fbf5;
  --danger: #d91f4e;
  --danger-soft: #fff0f4;
  --success: #0d8f7b;
  --success-soft: #e8fff9;
  --line: #2c2140;
  --border: #eadce9;
  --radius-lg: 28px;
  --radius-md: 14px;
  --shadow-hard: 8px 8px 0 rgba(255, 95, 158, 0.28), 22px 28px 60px rgba(120, 60, 120, 0.12);
  --ring: 0 0 0 4px rgba(255, 95, 158, 0.16);
  --font: "Hiragino Maru Gothic ProN", "Yu Gothic UI", "Segoe UI", system-ui,
    -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Noto Sans JP", "Helvetica Neue", Arial, sans-serif;
  --display: "Hiragino Maru Gothic ProN", "Yu Gothic UI", "Trebuchet MS",
    "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei",
    "Noto Sans JP", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

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

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background-color: #fff6fb;
  background-image:
    radial-gradient(rgba(255, 95, 158, 0.1) 1.2px, transparent 1.2px),
    radial-gradient(rgba(139, 108, 246, 0.08) 1.2px, transparent 1.2px);
  background-size: 26px 26px, 26px 26px;
  background-position: 0 0, 13px 13px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection {
  color: #fff;
  background: var(--pink);
}

button,
input {
  font: inherit;
}

a {
  color: var(--pink-deep);
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border: 2px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--yellow);
  font-size: 0.85rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--line);
  transform: translateY(-180%);
  transition: transform 0.2s ease;
}

.skip-link:focus-visible {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ */
/* Floating sakura petals                                             */
/* ------------------------------------------------------------------ */

.petal-field {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow: hidden;
  pointer-events: none;
}

.petal {
  position: absolute;
  top: -6vh;
  left: var(--x, 50%);
  width: var(--size, 13px);
  height: calc(var(--size, 13px) * 1.25);
  border-radius: 75% 0 75% 0;
  background: linear-gradient(135deg, #ff8fbe, #ffd6e7);
  opacity: 0.55;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.7));
  animation: petal-fall var(--dur, 18s) linear infinite;
  animation-delay: var(--delay, 0s);
}

.petal--1 {
  --x: 7%;
  --size: 13px;
  --dur: 19s;
  --delay: -4s;
}

.petal--2 {
  --x: 27%;
  --size: 9px;
  --dur: 24s;
  --delay: -14s;
}

.petal--3 {
  --x: 48%;
  --size: 11px;
  --dur: 21s;
  --delay: -8s;
}

.petal--4 {
  --x: 71%;
  --size: 14px;
  --dur: 26s;
  --delay: -18s;
}

.petal--5 {
  --x: 86%;
  --size: 10px;
  --dur: 20s;
  --delay: -2s;
}

.petal--6 {
  --x: 96%;
  --size: 8px;
  --dur: 23s;
  --delay: -11s;
}

/* ------------------------------------------------------------------ */
/* Shell                                                              */
/* ------------------------------------------------------------------ */

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  min-height: 100vh;
  min-height: 100dvh;
}

/* ------------------------------------------------------------------ */
/* Brand panel                                                        */
/* ------------------------------------------------------------------ */

.brand-panel {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(30px, 5vh, 60px);
  align-self: start;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  padding: clamp(30px, 4vw, 58px);
  border-right: 2px solid var(--line);
  background:
    radial-gradient(circle at 82% 6%, rgba(255, 255, 255, 0.72), transparent 34%),
    linear-gradient(148deg, #ffd6e8 0%, #eadcff 46%, #c9f1ff 100%);
}

.brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(44, 33, 64, 0.18) 1px, transparent 1px);
  background-size: 17px 17px;
  opacity: 0.32;
  -webkit-mask-image: linear-gradient(125deg, #000 0%, transparent 62%);
  mask-image: linear-gradient(125deg, #000 0%, transparent 62%);
  pointer-events: none;
}

.brand-panel::after {
  content: "";
  position: absolute;
  top: -190px;
  right: -200px;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 255, 255, 0.6) 0deg 5deg,
    transparent 5deg 13deg
  );
  opacity: 0.42;
  -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 68%);
  mask-image: radial-gradient(circle, #000 0%, transparent 68%);
  pointer-events: none;
}

.brand-star {
  position: absolute;
  z-index: 0;
  color: rgba(255, 255, 255, 0.78);
  font-family: var(--display);
  line-height: 1;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

.brand-star--1 {
  top: 18%;
  right: 9%;
  font-size: 44px;
  transform: rotate(12deg);
}

.brand-star--2 {
  bottom: 35%;
  left: 5%;
  font-size: 26px;
  transform: rotate(-14deg);
}

.brand-star--3 {
  right: 11%;
  bottom: 9%;
  color: rgba(255, 255, 255, 0.55);
  font-size: 58px;
  transform: rotate(18deg);
}

.brand-top,
.brand-copy,
.brand-foot {
  position: relative;
  z-index: 1;
}

.brand-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: var(--ink);
  text-decoration: none;
}

.logo-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(145deg, #ffa6c9 0%, #ff5f9e 58%, #8b6cf6 130%);
  box-shadow: 3px 3px 0 rgba(44, 33, 64, 0.9);
  transform: rotate(-3deg);
}

.logo-mark svg {
  width: 30px;
  height: 30px;
}

.logo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.06;
}

.logo-text strong {
  font-family: var(--display);
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.logo-text small {
  color: #8a3a74;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  margin-top: 9px;
  padding: 7px 13px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 253, 251, 0.74);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  box-shadow: 2px 2px 0 rgba(44, 33, 64, 0.14);
}

.badge-star {
  color: var(--pink-deep);
  font-size: 0.78rem;
}

.brand-copy {
  max-width: 600px;
  animation: rise-in 0.7s cubic-bezier(0.22, 0.9, 0.3, 1) both;
}

.brand-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border: 1.5px solid rgba(44, 33, 64, 0.18);
  border-radius: 999px;
  color: #a82264;
  background: rgba(255, 255, 255, 0.56);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-copy h1 {
  margin: 18px 0 0;
  padding-bottom: 0.08em;
  font-family: var(--display);
  font-size: clamp(2.35rem, 3.8vw, 3.7rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.045em;
  text-wrap: balance;
  background: linear-gradient(118deg, #2c2140 0%, #6034b5 48%, #e93b80 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-lede {
  max-width: 520px;
  margin: 18px 0 0;
  color: #5d4c72;
  font-size: clamp(0.9rem, 1.05vw, 0.98rem);
  line-height: 1.72;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 10px 13px;
  border: 1.5px solid rgba(44, 33, 64, 0.1);
  border-radius: 16px;
  background: rgba(255, 253, 251, 0.52);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.feature-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: var(--pink-soft);
  box-shadow: 2px 2px 0 rgba(44, 33, 64, 0.12);
}

.feature-list li:nth-child(2) .feature-icon {
  background: var(--sky-soft);
}

.feature-list li:nth-child(3) .feature-icon {
  background: var(--yellow-soft);
}

.feature-icon svg {
  width: 20px;
  height: 20px;
}

.feature-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 1px;
}

.feature-text strong {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
}

.feature-text span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.brand-foot {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero-stats {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  width: -moz-fit-content;
  width: fit-content;
  padding: 10px 17px;
  border: 1.5px solid rgba(44, 33, 64, 0.15);
  border-radius: 18px;
  background: rgba(255, 253, 251, 0.58);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.stat strong {
  font-family: var(--display);
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.stat span {
  color: var(--muted);
  font-size: 0.71rem;
  font-weight: 600;
}

.stat-sep {
  width: 1px;
  height: 32px;
  background: repeating-linear-gradient(
    180deg,
    rgba(44, 33, 64, 0.24) 0 4px,
    transparent 4px 8px
  );
}

.mascot-row {
  display: flex;
  align-items: flex-end;
  gap: 14px;
}

.mascot-frame {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 124px;
  height: 124px;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #fffdfb 0%, #ffe3f0 72%);
  box-shadow: 4px 4px 0 rgba(44, 33, 64, 0.16);
}

.mascot-halo {
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 12deg,
    rgba(255, 255, 255, 0.9) 0deg 7deg,
    transparent 7deg 16deg
  );
  opacity: 0.7;
  -webkit-mask-image: radial-gradient(circle, transparent 0 42%, #000 70%);
  mask-image: radial-gradient(circle, transparent 0 42%, #000 70%);
}

.mascot-frame svg {
  position: relative;
  z-index: 1;
  width: 112%;
  height: 112%;
}

.speech-bubble {
  position: relative;
  max-width: 310px;
  margin: 0 0 8px;
  padding: 13px 16px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 4px 4px 0 rgba(44, 33, 64, 0.13);
}

.speech-bubble::before,
.speech-bubble::after {
  content: "";
  position: absolute;
  left: -9px;
  bottom: 15px;
  width: 16px;
  height: 16px;
  background: var(--paper);
  border-left: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  transform: rotate(45deg);
}

.speech-bubble::after {
  left: -6px;
  bottom: 17px;
  width: 13px;
  height: 13px;
  border: 0;
}

.speech-bubble p {
  margin: 0;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.55;
}

.speech-bubble cite {
  display: block;
  margin-top: 5px;
  color: var(--pink-deep);
  font-size: 0.69rem;
  font-style: normal;
  font-weight: 700;
}

/* ------------------------------------------------------------------ */
/* Form panel                                                         */
/* ------------------------------------------------------------------ */

.form-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding:
    max(24px, env(safe-area-inset-top))
    clamp(22px, 3.8vw, 56px)
    max(24px, env(safe-area-inset-bottom));
  background:
    radial-gradient(36rem 28rem at 100% 0%, rgba(255, 166, 210, 0.2), transparent 64%),
    radial-gradient(32rem 26rem at 0% 100%, rgba(139, 108, 246, 0.12), transparent 62%),
    rgba(255, 250, 253, 0.66);
}

.panel-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
}

.mobile-logo {
  display: none;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--ink);
  text-decoration: none;
}

.mobile-logo .logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  box-shadow: 2px 2px 0 rgba(44, 33, 64, 0.9);
}

.mobile-logo .logo-mark svg {
  width: 23px;
  height: 23px;
}

.mobile-logo .logo-text strong {
  font-size: 1.02rem;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 3px 3px 0 rgba(44, 33, 64, 0.13);
}

.lang-switch a {
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.lang-switch a:hover {
  color: var(--ink);
  background: var(--pink-soft);
}

.lang-switch a.is-active {
  color: #fff;
  background: linear-gradient(135deg, #ff83b8 0%, #ff4f98 100%);
  box-shadow: inset 0 -2px 0 rgba(138, 0, 63, 0.18);
}

.panel-center {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 478px;
  margin: auto;
  padding: clamp(30px, 6vh, 66px) 0;
}

.auth-card {
  position: relative;
  padding: clamp(28px, 3vw, 38px);
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-hard);
  animation: card-in 0.6s cubic-bezier(0.22, 0.9, 0.3, 1) both;
}

.auth-card::before {
  content: "✦";
  position: absolute;
  top: -19px;
  right: 26px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 2px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: var(--yellow);
  font-family: var(--display);
  font-size: 1.05rem;
  line-height: 1;
  box-shadow: 2px 2px 0 rgba(44, 33, 64, 0.2);
  transform: rotate(10deg);
}

.legal {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 0.71rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.02em;
}

.legal span {
  margin: 0 5px;
  color: var(--pink);
}

/* ------------------------------------------------------------------ */
/* Forms                                                              */
/* ------------------------------------------------------------------ */

.page-head {
  margin-bottom: 24px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1.5px solid #ffabc9;
  border-radius: 999px;
  color: #b11d60;
  background: #ffeaf3;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  box-shadow: 2px 2px 0 rgba(255, 95, 158, 0.15);
}

.eyebrow::before {
  content: "✦";
  color: var(--pink-deep);
  font-size: 0.7rem;
}

.page-head h2,
.state-panel h2 {
  margin: 13px 0 0;
  font-family: var(--display);
  color: var(--ink);
  font-size: clamp(1.66rem, 2.4vw, 1.98rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.page-head > p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.62;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label,
.label-row > label {
  color: var(--ink-soft);
  font-size: 0.79rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.control {
  position: relative;
  display: flex;
  align-items: center;
}

.control-icon {
  position: absolute;
  left: 15px;
  width: 18px;
  height: 18px;
  color: #b17ba6;
  pointer-events: none;
  transition: color 0.2s ease;
}

.control input {
  width: 100%;
  height: 51px;
  padding: 0 15px 0 44px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--ink);
  background: #fff9fc;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.control input::placeholder {
  color: #b4a2bd;
  opacity: 1;
}

.control input:hover {
  border-color: #dfc8df;
}

.control input:focus {
  border-color: #ff8fbe;
  background: #fffdfb;
  box-shadow: var(--ring);
}

.control:focus-within .control-icon {
  color: var(--pink-deep);
}

.control input.input-mono {
  padding-right: 44px;
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.control input[type="password"] {
  padding-right: 52px;
}

.control input:-webkit-autofill,
.control input:-webkit-autofill:hover,
.control input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px #fff6fb inset;
  caret-color: var(--ink);
  transition: background-color 9999s ease-in-out 0s;
}

.toggle-password {
  position: absolute;
  right: 6px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: var(--muted-2);
  background: transparent;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.toggle-password:hover {
  color: var(--pink-deep);
  background: var(--pink-soft);
}

.toggle-password svg {
  width: 18px;
  height: 18px;
}

.toggle-password .icon-eye-off {
  display: none;
}

.toggle-password[aria-pressed="true"] .icon-eye {
  display: none;
}

.toggle-password[aria-pressed="true"] .icon-eye-off {
  display: block;
}

.hint {
  margin: -1px 0 0;
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.5;
}

.hint--icon {
  display: flex;
  align-items: flex-start;
  gap: 7px;
}

.hint--icon svg {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin-top: 1px;
  color: var(--purple);
}

.field-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.45;
}

.field.is-invalid .control input {
  border-color: #ff8daa;
  background: #fff7f9;
  box-shadow: 0 0 0 4px rgba(255, 95, 128, 0.1);
}

.field.is-invalid .control-icon {
  color: var(--danger);
}

.field.is-invalid .checkbox {
  color: var(--danger);
}

.field.shake {
  animation: field-shake 0.4s ease;
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: -1px;
}

.checkbox {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.checkbox input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  border-radius: 5px;
  accent-color: var(--pink-deep);
  cursor: pointer;
}

.checkbox--terms {
  color: var(--muted);
  font-size: 0.78rem;
}

.field--checkbox {
  gap: 6px;
}

.text-link {
  color: var(--pink-deep);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s ease;
}

.text-link:hover {
  color: #b11d60;
  text-decoration: underline;
  text-decoration-style: wavy;
  text-underline-offset: 3px;
}

.text-link--small {
  font-size: 0.75rem;
}

.alt {
  margin: 21px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.alt a {
  color: var(--pink-deep);
  font-weight: 800;
  text-decoration: none;
}

.alt a:hover {
  text-decoration: underline;
  text-decoration-style: wavy;
  text-underline-offset: 3px;
}

/* Buttons */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 51px;
  padding: 12px 20px;
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  font-family: var(--display);
  font-size: 0.94rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease,
    opacity 0.18s ease;
}

.btn--primary {
  margin-top: 4px;
  color: #fff;
  background: linear-gradient(135deg, #ff8fbe 0%, #ff4f98 55%, #ff6f61 100%);
  box-shadow:
    0 5px 0 var(--line),
    0 14px 26px rgba(233, 59, 128, 0.24);
  text-shadow: 0 1px 0 rgba(44, 33, 64, 0.2);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 7px 0 var(--line),
    0 18px 30px rgba(233, 59, 128, 0.28);
}

.btn--primary:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--line);
}

.btn--ghost {
  margin-top: 20px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 4px 0 var(--line);
}

.btn--ghost:hover {
  transform: translateY(-1px);
  background: var(--yellow-soft);
  box-shadow: 0 5px 0 var(--line);
}

.btn--ghost:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--line);
}

.btn--ghost svg {
  width: 17px;
  height: 17px;
}

.btn[disabled] {
  opacity: 0.62;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 3px 0 var(--line);
}

.spinner {
  display: none;
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.form.is-busy .spinner {
  display: block;
}

.form.is-busy .btn {
  pointer-events: none;
}

/* Alerts */

.alert {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  padding: 12px 14px;
  border: 2px solid transparent;
  border-radius: 14px;
  font-size: 0.81rem;
  font-weight: 600;
  line-height: 1.5;
  animation: alert-in 0.3s ease both;
}

.alert-icon {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin-top: 1px;
}

.alert-icon--success {
  display: none;
}

.alert--success .alert-icon--error {
  display: none;
}

.alert--success .alert-icon--success {
  display: block;
}

.alert--error {
  border-color: #ffb3c6;
  color: #a61b48;
  background: var(--danger-soft);
}

.alert--success {
  border-color: #8fe3d3;
  color: var(--success);
  background: var(--success-soft);
}

/* Demo credentials */

.demo-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 12px;
  margin-top: 23px;
  padding: 14px 15px;
  border: 2px dashed #f0c35b;
  border-radius: 16px;
  background: #fffae5;
}

.demo-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  color: #9a6500;
  background: var(--yellow);
  box-shadow: 2px 2px 0 rgba(44, 33, 64, 0.12);
}

.demo-icon svg {
  width: 17px;
  height: 17px;
}

.demo-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.demo-copy strong {
  color: #765100;
  font-size: 0.76rem;
  font-weight: 800;
}

.demo-copy span {
  color: #9a7a34;
  font-size: 0.71rem;
  line-height: 1.45;
}

.demo-creds {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
}

.demo-creds code {
  padding: 4px 8px;
  border: 1.5px solid #edd9a2;
  border-radius: 7px;
  color: #765100;
  background: #fffdf6;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.01em;
}

.demo-sep {
  color: #b99138;
  font-size: 0.7rem;
}

/* Password strength */

.strength {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 2px;
}

.strength-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
}

.strength-label {
  font-weight: 800;
  transition: color 0.2s ease;
}

.strength-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.strength-bars span {
  height: 5px;
  border-radius: 999px;
  background: #f1e5ef;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.strength[data-score="1"] .strength-bars span:nth-child(1) {
  background: #ff6b81;
}
.strength[data-score="1"] .strength-label {
  color: #d92b4b;
}

.strength[data-score="2"] .strength-bars span:nth-child(-n + 2) {
  background: #f2b12f;
}
.strength[data-score="2"] .strength-label {
  color: #b47b00;
}

.strength[data-score="3"] .strength-bars span:nth-child(-n + 3) {
  background: #2dd4bf;
}
.strength[data-score="3"] .strength-label {
  color: #0d8f7b;
}

.strength[data-score="4"] .strength-bars span {
  background: #ff5f9e;
}
.strength[data-score="4"] .strength-label {
  color: var(--pink-deep);
}

/* ------------------------------------------------------------------ */
/* Forgot password success state                                      */
/* ------------------------------------------------------------------ */

.state-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  animation: alert-in 0.4s ease both;
}

.state-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-bottom: 21px;
  border: 2px solid var(--line);
  border-radius: 20px;
  color: var(--pink-deep);
  background: linear-gradient(145deg, #ffeaf3, #ffd0e3);
  box-shadow: 3px 3px 0 rgba(44, 33, 64, 0.16);
  transform: rotate(-4deg);
}

.state-icon svg {
  width: 29px;
  height: 29px;
}

.state-panel h2 {
  margin-top: 13px;
  outline: none;
}

.state-body {
  margin: 12px 0 21px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.68;
}

.sent-to {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 12px 15px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: #fff9fc;
}

.sent-to span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.sent-to strong {
  min-width: 0;
  color: var(--ink);
  font-size: 0.81rem;
  font-weight: 800;
  overflow-wrap: anywhere;
  text-align: right;
}

.state-panel .btn {
  width: 100%;
}

.state-back {
  align-self: center;
  margin-top: 16px;
}

/* ------------------------------------------------------------------ */
/* Celebration sparkles                                               */
/* ------------------------------------------------------------------ */

.alert.is-celebrating,
.state-icon.is-celebrating {
  overflow: visible;
}

.sparkle {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 30;
  color: var(--sc, #ff5f9e);
  font-size: 15px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  animation: sparkle-pop 0.95s cubic-bezier(0.18, 0.75, 0.3, 1) forwards;
  animation-delay: var(--sd, 0s);
}

.sparkle-1  { --dx: -74px; --dy: -46px; --sc: #ff5f9e; --sd: 0s; }
.sparkle-2  { --dx: -32px; --dy: -72px; --sc: #8b6cf6; --sd: 0.03s; }
.sparkle-3  { --dx: 18px;  --dy: -78px; --sc: #ffd166; --sd: 0s; }
.sparkle-4  { --dx: 68px;  --dy: -44px; --sc: #4fbdf6; --sd: 0.06s; }
.sparkle-5  { --dx: 82px;  --dy: 6px;   --sc: #ff5f9e; --sd: 0.02s; }
.sparkle-6  { --dx: 62px;  --dy: 56px;  --sc: #2dd4bf; --sd: 0.08s; }
.sparkle-7  { --dx: 18px;  --dy: 76px;  --sc: #ffd166; --sd: 0.04s; }
.sparkle-8  { --dx: -36px; --dy: 68px;  --sc: #ff5f9e; --sd: 0s; }
.sparkle-9  { --dx: -80px; --dy: 28px;  --sc: #8b6cf6; --sd: 0.05s; }
.sparkle-10 { --dx: -68px; --dy: -14px; --sc: #4fbdf6; --sd: 0.09s; }
.sparkle-11 { --dx: 34px;  --dy: -24px; --sc: #2dd4bf; --sd: 0.07s; }
.sparkle-12 { --dx: -12px; --dy: 44px;  --sc: #8b6cf6; --sd: 0.03s; }

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 1160px) {
  .brand-panel {
    padding: 34px;
  }

  .brand-copy h1 {
    font-size: clamp(2.05rem, 3.3vw, 3rem);
  }

  .feature-list {
    margin-top: 22px;
  }

  .speech-bubble {
    max-width: 260px;
  }

  .mascot-frame {
    width: 108px;
    height: 108px;
  }
}

@media (max-width: 940px) {
  .shell {
    display: block;
  }

  .brand-panel {
    display: none;
  }

  .form-panel {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    padding:
      max(18px, env(safe-area-inset-top))
      clamp(18px, 5vw, 40px)
      max(24px, env(safe-area-inset-bottom));
    background:
      radial-gradient(38rem 28rem at 100% -8%, rgba(255, 166, 210, 0.26), transparent 62%),
      radial-gradient(34rem 26rem at 0% 110%, rgba(139, 108, 246, 0.14), transparent 65%),
      rgba(255, 250, 253, 0.5);
  }

  .panel-top {
    max-width: 482px;
    margin: 0 auto;
  }

  .mobile-logo {
    display: inline-flex;
  }

  .panel-center {
    max-width: 482px;
    padding: clamp(28px, 5vh, 50px) 0 20px;
  }
}

@media (max-width: 560px) {
  .petal-field {
    opacity: 0.7;
  }

  .petal--4,
  .petal--5,
  .petal--6 {
    display: none;
  }

  .form-panel {
    padding-left: 16px;
    padding-right: 16px;
  }

  .panel-center {
    padding-top: 26px;
  }

  .auth-card {
    padding: 25px 21px 24px;
    border-radius: 24px;
    box-shadow: 6px 6px 0 rgba(255, 95, 158, 0.25), 14px 18px 40px rgba(120, 60, 120, 0.1);
  }

  .auth-card::before {
    right: 20px;
    width: 34px;
    height: 34px;
    font-size: 0.95rem;
  }

  .page-head {
    margin-bottom: 21px;
  }

  .page-head h2,
  .state-panel h2 {
    font-size: clamp(1.5rem, 6vw, 1.78rem);
  }

  .lang-switch {
    padding: 2px;
    box-shadow: 2px 2px 0 rgba(44, 33, 64, 0.13);
  }

  .lang-switch a {
    padding: 6px 9px;
    font-size: 0.7rem;
  }

  .mobile-logo .logo-text small {
    display: none;
  }

  .control input {
    height: 49px;
    font-size: 16px;
  }

  .btn {
    min-height: 49px;
    font-size: 0.91rem;
  }

  .demo-box {
    margin-top: 19px;
  }

  .legal {
    margin-top: 20px;
  }
}

@media (max-width: 380px) {
  .mobile-logo .logo-text {
    display: none;
  }

  .lang-switch a {
    padding: 6px 7px;
    font-size: 0.67rem;
  }

  .auth-card {
    padding-left: 17px;
    padding-right: 17px;
  }
}

@media (max-height: 840px) and (min-width: 941px) {
  .brand-panel {
    padding-top: 32px;
    padding-bottom: 32px;
  }

  .brand-copy h1 {
    font-size: clamp(2rem, 3vw, 2.85rem);
  }

  .brand-lede {
    margin-top: 12px;
    font-size: 0.87rem;
  }

  .feature-list {
    gap: 7px;
    margin-top: 18px;
  }

  .feature-list li {
    padding: 7px 10px;
  }

  .feature-icon {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  .brand-foot {
    gap: 12px;
  }

  .hero-stats {
    padding: 7px 13px;
  }

  .mascot-frame {
    width: 92px;
    height: 92px;
  }

  .speech-bubble {
    margin-bottom: 4px;
    padding: 10px 13px;
  }

  .speech-bubble p {
    font-size: 0.76rem;
  }

  .panel-center {
    padding-top: 26px;
    padding-bottom: 26px;
  }
}

/* ------------------------------------------------------------------ */
/* Motion                                                              */
/* ------------------------------------------------------------------ */

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(18px) rotate(0.3deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes alert-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes field-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-5px);
  }
  40% {
    transform: translateX(5px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(3px);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes petal-fall {
  0% {
    transform: translate3d(0, -8vh, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(34px, 50vh, 0) rotate(170deg);
  }
  100% {
    transform: translate3d(-18px, 112vh, 0) rotate(340deg);
  }
}

@keyframes sparkle-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2) rotate(0deg);
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy)))
      scale(1.2) rotate(160deg);
  }
}

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

  .petal-field {
    display: none;
  }
}
