/* Mini2API Q-style presentation layer, served by nginx. The official application is unmodified.
   Everything is scoped by html[data-m2] or m2- classes, so other pages keep the official look.
   Auth-page selectors are pinned to the official v0.2.20 AuthLayout markup. */

@font-face {
  font-family: Fredoka;
  src: url(fredoka.woff2) format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

html[data-m2] {
  --m2-ink: #3b2a4a;
  --m2-line: #3b2a4a;
  --m2-paper: #fff7ec;
  --m2-dot: #f5dcc4;
  --m2-card: #fff;
  --m2-field: #fff;
  --m2-text: #3b2a4a;
  --m2-muted: #75658a;
  --m2-link: #d6336c;
  --m2-pink: #ff8fb3;
  --m2-pink-soft: #ffe3ec;
  --m2-mint: #9be8d0;
  --m2-sky: #a5d6ff;
  --m2-butter: #ffd76a;
  --m2-lilac: #cdb8ff;
  --m2-font: Fredoka, ui-rounded, "Arial Rounded MT Bold", system-ui, -apple-system, "Segoe UI", sans-serif;
}

html.dark[data-m2] {
  --m2-line: #120b1d;
  --m2-paper: #241a36;
  --m2-dot: #302446;
  --m2-card: #392c53;
  --m2-field: #2a2040;
  --m2-text: #fff3e6;
  --m2-muted: #cbbfdd;
  --m2-link: #ff9dbd;
  --m2-pink-soft: #4b3352;
}

html[data-m2="leaving"] body { visibility: hidden; }

/* ---------- shared pieces ---------- */

.m2-brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: var(--m2-text);
  font: 700 1.5rem/1 var(--m2-font);
  text-decoration: none;
}
.m2-brand img { width: 44px; height: 44px; transition: transform .2s; }
.m2-brand:hover img { transform: rotate(-8deg) scale(1.06); }

.m2-bubble {
  position: relative;
  display: inline-block;
  padding: .55rem 1rem;
  border: 3px solid var(--m2-line);
  border-radius: 22px;
  background: var(--m2-card);
  color: var(--m2-text);
  font-weight: 600;
  box-shadow: 0 4px 0 var(--m2-line);
}
.m2-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -11px;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  border: solid var(--m2-line);
  border-width: 0 3px 3px 0;
  background: inherit;
  transform: rotate(45deg);
}

@keyframes m2-float {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50% { transform: translateY(-10px) rotate(var(--r, 0deg)); }
}

@media (prefers-reduced-motion: reduce) {
  [class^="m2-"], [class*=" m2-"] { animation: none !important; transition: none !important; }
}

/* ---------- home page ---------- */

html[data-m2="home"] { scroll-behavior: smooth; scroll-padding-top: 6rem; }
:where(html[data-m2="home"]) :where(*, ::before, ::after) { box-sizing: border-box; }
:where(html[data-m2="home"]) :where(h1, h2, h3, p, ul, ol, pre) { margin: 0; }
:where(html[data-m2="home"]) :where(ul, ol) { padding: 0; list-style: none; }
:where(html[data-m2="home"]) :where(img, svg) { display: block; max-width: 100%; height: auto; }
:where(html[data-m2="home"]) :focus-visible { outline: 3px solid var(--m2-sky); outline-offset: 3px; }

html[data-m2="home"] body {
  margin: 0;
  overflow-x: hidden;
  background: var(--m2-paper) radial-gradient(var(--m2-dot) 2px, transparent 2.5px) 0 0 / 26px 26px;
  color: var(--m2-text);
  font: 400 1.0625rem/1.6 var(--m2-font);
  -webkit-font-smoothing: antialiased;
}

.m2-skip { position: absolute; left: -999px; }
.m2-skip:focus { left: 1rem; top: 1rem; z-index: 30; padding: .5rem 1rem; background: var(--m2-card); color: var(--m2-text); }

.m2-wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }

.m2-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .85rem 1.6rem;
  border: 3px solid var(--m2-line);
  border-radius: 999px;
  background: var(--m2-pink);
  color: var(--m2-ink);
  font: 600 1.125rem/1.2 var(--m2-font);
  text-decoration: none;
  box-shadow: 0 5px 0 var(--m2-line);
  transition: transform .12s, box-shadow .12s;
}
.m2-btn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--m2-line); }
.m2-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--m2-line); }
.m2-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.m2-btn-plain { background: var(--m2-card); color: var(--m2-text); }
.m2-btn-sm { padding: .5rem 1.1rem; font-size: 1rem; box-shadow: 0 4px 0 var(--m2-line); }

.m2-nav {
  position: sticky;
  top: .75rem;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(1120px, 100% - 1.5rem);
  margin: .75rem auto 0;
  padding: .55rem .7rem .55rem 1rem;
  border: 3px solid var(--m2-line);
  border-radius: 999px;
  background: var(--m2-card);
  box-shadow: 0 5px 0 var(--m2-line);
}
.m2-nav-links { display: none; gap: .25rem; }
.m2-nav-links a {
  padding: .35rem .9rem;
  border-radius: 999px;
  color: var(--m2-text);
  font-weight: 500;
  text-decoration: none;
}
.m2-nav-links a:hover { background: var(--m2-pink-soft); }
.m2-nav-actions { display: flex; align-items: center; gap: .6rem; }
.m2-icon-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 3px solid var(--m2-line);
  border-radius: 50%;
  background: var(--m2-butter);
  color: var(--m2-ink);
  cursor: pointer;
  transition: transform .2s;
}
.m2-icon-btn:hover { transform: rotate(20deg); }
.m2-icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
html:not(.dark) .m2-sun, html.dark .m2-moon { display: none; }

.m2-hero { display: grid; gap: 2.5rem; align-items: center; padding: 3rem 0 3.5rem; text-align: center; }
.m2-kicker {
  display: inline-block;
  margin-bottom: 1.1rem;
  padding: .3rem .95rem;
  border: 3px solid var(--m2-line);
  border-radius: 999px;
  background: var(--m2-butter);
  color: var(--m2-ink);
  font-weight: 600;
  font-size: .95rem;
  line-height: 1.4;
  transform: rotate(-2deg);
}
.m2-hero h1 { font-size: clamp(2.3rem, 6.2vw, 4.1rem); font-weight: 700; line-height: 1.08; }
.m2-mark { background: linear-gradient(transparent 60%, var(--m2-pink) 60% 92%, transparent 92%); }
.m2-lead { max-width: 34rem; margin: 1.25rem auto 2rem; color: var(--m2-muted); font-size: 1.25rem; line-height: 1.5; }
.m2-cta-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1rem; }
.m2-ticks { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.4rem; margin-top: 1.75rem; color: var(--m2-muted); font-weight: 500; }
.m2-ticks li::before { content: "\2726"; margin-right: .4rem; color: var(--m2-pink); }

.m2-hero-art { position: relative; display: grid; place-items: center; width: min(430px, 100%); aspect-ratio: 1; margin-inline: auto; }
.m2-hero-art::before {
  content: "";
  position: absolute;
  inset: 9%;
  border: 3px solid var(--m2-line);
  border-radius: 50%;
  background: var(--m2-butter);
  box-shadow: 0 8px 0 var(--m2-line);
}
.m2-hero-art img { position: relative; width: 70%; }
.m2-chip {
  position: absolute;
  z-index: 1;
  padding: .4rem 1.05rem;
  border: 3px solid var(--m2-line);
  border-radius: 999px;
  color: var(--m2-ink);
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.3;
  box-shadow: 0 4px 0 var(--m2-line);
  animation: m2-float 4s ease-in-out infinite;
}
.m2-chip-a { left: 0; top: 17%; background: var(--m2-pink); --r: -8deg; }
.m2-chip-b { right: 0; top: 45%; background: var(--m2-mint); --r: 7deg; animation-delay: -1.3s; }
.m2-chip-c { left: 4%; bottom: 9%; background: var(--m2-sky); --r: 5deg; animation-delay: -2.6s; }
.m2-hero-bubble { position: absolute; z-index: 1; right: 2%; top: 1%; }

.m2-section { padding: 3.5rem 0; }
.m2-head { margin-bottom: 2.5rem; text-align: center; }
.m2-head h2 { font-size: clamp(1.9rem, 4vw, 2.75rem); font-weight: 700; line-height: 1.15; }
.m2-head h2 + p { margin-top: .6rem; color: var(--m2-muted); font-size: 1.125rem; }

.m2-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 1.5rem; }
.m2-card {
  padding: 1.6rem;
  border: 3px solid var(--m2-line);
  border-radius: 28px;
  background: var(--m2-card);
  box-shadow: 0 6px 0 var(--m2-line);
  transition: transform .18s;
}
.m2-card:hover { transform: translateY(-4px) rotate(-1deg); }
.m2-card:nth-child(even):hover { transform: translateY(-4px) rotate(1deg); }
.m2-card h3 { margin: 1rem 0 .35rem; font-size: 1.3rem; font-weight: 600; line-height: 1.25; }
.m2-card p { color: var(--m2-muted); }
.m2-ic {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 3px solid var(--m2-line);
  border-radius: 20px;
  transform: rotate(-5deg);
}
.m2-ic svg { width: 44px; height: 44px; fill: none; stroke: var(--m2-ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.m2-t-pink { background: var(--m2-pink); }
.m2-t-mint { background: var(--m2-mint); }
.m2-t-sky { background: var(--m2-sky); }
.m2-t-butter { background: var(--m2-butter); }
.m2-t-lilac { background: var(--m2-lilac); }
.m2-f-white { fill: #fff; }
.m2-f-pink { fill: var(--m2-pink); }
.m2-f-butter { fill: var(--m2-butter); }

.m2-how { display: grid; gap: 2.25rem; align-items: center; }
.m2-steps { display: grid; gap: 1.1rem; counter-reset: step; }
.m2-steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .1rem 1rem;
  padding: 1.1rem 1.25rem;
  border: 3px solid var(--m2-line);
  border-radius: 24px;
  background: var(--m2-card);
  box-shadow: 0 5px 0 var(--m2-line);
}
.m2-steps li::before {
  counter-increment: step;
  content: counter(step);
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 3px solid var(--m2-line);
  border-radius: 50%;
  background: var(--m2-butter);
  color: var(--m2-ink);
  font-weight: 700;
  font-size: 1.3rem;
}
.m2-steps h3 { font-size: 1.2rem; font-weight: 600; line-height: 1.3; }
.m2-steps p { color: var(--m2-muted); }

.m2-term {
  min-width: 0;
  overflow: hidden;
  border: 3px solid var(--m2-line);
  border-radius: 26px;
  background: #33243f;
  color: #fff3e6;
  box-shadow: 0 7px 0 var(--m2-line);
}
.m2-term-bar {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .65rem 1rem;
  border-bottom: 3px solid var(--m2-line);
  background: var(--m2-pink);
  color: var(--m2-ink);
  font-weight: 600;
  font-size: .95rem;
}
.m2-term-bar i { width: 14px; height: 14px; border: 2.5px solid var(--m2-line); border-radius: 50%; background: #fff; }
.m2-term-bar i:nth-child(2) { background: var(--m2-butter); }
.m2-term-bar i:nth-child(3) { background: var(--m2-mint); }
.m2-term-bar span { margin-left: .4rem; }
.m2-term pre { padding: 1.2rem 1rem 1.4rem; overflow-x: auto; font: 500 clamp(.68rem, 2.9vw, .92rem)/1.8 Consolas, Menlo, "SF Mono", ui-monospace, monospace; }
.m2-c { color: #b9a8cb; }
.m2-p { color: var(--m2-mint); }
.m2-s { color: var(--m2-butter); }
.m2-ok { padding: .1rem .55rem; border-radius: 999px; background: var(--m2-mint); color: var(--m2-ink); font-weight: 700; }

.m2-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; }
.m2-tools li {
  padding: .5rem 1.2rem;
  border: 3px solid var(--m2-line);
  border-radius: 999px;
  background: var(--m2-card);
  font-weight: 600;
  box-shadow: 0 4px 0 var(--m2-line);
}
.m2-tools li:nth-child(odd) { transform: rotate(-2deg); }
.m2-tools li:nth-child(even) { transform: rotate(2deg); }

.m2-faq { display: grid; gap: 1rem; max-width: 760px; margin-inline: auto; }
.m2-faq details {
  padding: 0 1.25rem;
  border: 3px solid var(--m2-line);
  border-radius: 22px;
  background: var(--m2-card);
  box-shadow: 0 5px 0 var(--m2-line);
}
.m2-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.3;
  list-style: none;
  cursor: pointer;
}
.m2-faq summary::-webkit-details-marker { display: none; }
.m2-faq summary::after {
  content: "+";
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 3px solid var(--m2-line);
  border-radius: 50%;
  background: var(--m2-mint);
  color: var(--m2-ink);
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1;
  transition: transform .2s;
}
.m2-faq details[open] summary::after { background: var(--m2-pink); transform: rotate(45deg); }
.m2-faq p { padding-bottom: 1.1rem; color: var(--m2-muted); }
.m2-faq code { padding: .05rem .4rem; border-radius: 8px; background: var(--m2-pink-soft); color: var(--m2-text); font-size: .9em; }

.m2-band {
  display: grid;
  gap: 1.25rem;
  align-items: center;
  justify-items: center;
  padding: 2.25rem 1.5rem;
  border: 3px solid var(--m2-line);
  border-radius: 36px;
  background: var(--m2-pink);
  color: var(--m2-ink);
  text-align: center;
  box-shadow: 0 8px 0 var(--m2-line);
}
.m2-band img { width: 130px; }
.m2-band h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); font-weight: 700; line-height: 1.15; }
.m2-band p { font-size: 1.1rem; }

.m2-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem 1.5rem;
  padding: 2.5rem 0 3rem;
  color: var(--m2-muted);
  font-size: .95rem;
}
.m2-foot a { color: inherit; }
.m2-foot a:hover { color: var(--m2-link); }
.m2-foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.25rem; }

@media (min-width: 760px) {
  .m2-nav-links { display: flex; }
  .m2-band { grid-template-columns: auto 1fr auto; justify-items: start; padding: 2.5rem 3rem; text-align: left; }
  .m2-foot { justify-content: space-between; }
}
@media (min-width: 900px) {
  .m2-hero { grid-template-columns: 1.1fr .9fr; padding: 4.5rem 0 4rem; text-align: left; }
  .m2-lead { margin-inline: 0; }
  .m2-cta-row, .m2-ticks { justify-content: flex-start; }
  .m2-how { grid-template-columns: 1fr 1fr; }
  .m2-term { transform: rotate(1.5deg); }
}

/* ---------- login and forgot-password (official AuthLayout, restyled) ---------- */

html[data-m2="auth"] body {
  background: var(--m2-paper) radial-gradient(var(--m2-dot) 2px, transparent 2.5px) 0 0 / 26px 26px;
  color: var(--m2-text);
  font-family: var(--m2-font);
}
html[data-m2="auth"] #app > .min-h-screen > .absolute { display: none; }

/* brand block above the card */
html[data-m2="auth"] #app > .min-h-screen > .z-10 > .mb-8 > div {
  width: 56px;
  height: 56px;
  border-radius: 0;
  background: url(img/icon.svg) center / contain no-repeat;
  box-shadow: none;
}
html[data-m2="auth"] #app > .min-h-screen > .z-10 > .mb-8 img { visibility: hidden; }
html[data-m2="auth"] #app > .min-h-screen > .z-10 > .mb-8 h1 {
  background: none;
  color: var(--m2-text);
  font-weight: 700;
}
html[data-m2="auth"] #app > .min-h-screen > .z-10 > .mb-8 p,
html[data-m2="auth"] #app > .min-h-screen > .z-10 > .mt-6 p,
html[data-m2="auth"] #app > .min-h-screen > .z-10 > .mt-8 { color: var(--m2-muted); }
html[data-m2="auth"] #app > .min-h-screen > .z-10 > .mt-6 { font-size: 1rem; }

/* the card, with Mimi peeking over its top edge */
html[data-m2="auth"] .card-glass {
  position: relative;
  margin-top: 94px;
  padding: 2.25rem 1.75rem 1.9rem;
  border: 3px solid var(--m2-line);
  border-radius: 32px;
  background: var(--m2-card);
  box-shadow: 0 8px 0 var(--m2-line);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
html[data-m2="auth"] .card-glass::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -89px;
  width: 150px;
  height: 97px;
  margin-left: -75px;
  background: url(img/mimi-peek.svg) center / contain no-repeat;
  pointer-events: none;
}
html[data-m2="auth"] .card-glass:has(input[type="password"]:focus)::before { background-image: url(img/mimi-shy.svg); }

html[data-m2="auth"] .card-glass h2 { color: var(--m2-text); font-size: 1.85rem; font-weight: 700; line-height: 1.15; }
html[data-m2="auth"] .card-glass h2 + p { color: var(--m2-muted); font-size: 1rem; }
html[data-m2="auth"] .input-label { color: var(--m2-text); font-size: 1rem; font-weight: 600; }

html[data-m2="auth"] .input {
  padding-top: .7rem;
  padding-bottom: .7rem;
  border: 3px solid var(--m2-line);
  border-radius: 18px;
  background: var(--m2-field);
  color: var(--m2-text);
  font-size: 1rem;
}
html[data-m2="auth"] .input:focus { border-color: var(--m2-pink); box-shadow: 0 0 0 4px rgb(255 143 179 / .35); }
html[data-m2="auth"] .input.input-error { border-color: #e5484d; }
html[data-m2="auth"] .input:disabled { background: var(--m2-pink-soft); }

html[data-m2="auth"] .btn {
  padding: .8rem 1.25rem;
  border: 3px solid var(--m2-line);
  border-radius: 999px;
  font-size: 1.1rem;
  font-weight: 600;
  box-shadow: 0 5px 0 var(--m2-line);
  transition: transform .12s, box-shadow .12s;
}
html[data-m2="auth"] .btn:focus-visible { outline: 3px solid var(--m2-sky); outline-offset: 3px; }
html[data-m2="auth"] .btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 7px 0 var(--m2-line); }
html[data-m2="auth"] .btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--m2-line); }
html[data-m2="auth"] .btn-primary { background: var(--m2-pink); }
html[data-m2="auth"] .btn-primary,
html[data-m2="auth"] .btn-primary svg { color: var(--m2-ink); }
html[data-m2="auth"] .btn-secondary { background: var(--m2-card); color: var(--m2-text); }

html[data-m2="auth"] #app a { color: var(--m2-link); font-weight: 600; }
html[data-m2="auth"] #app a:hover { text-decoration: underline wavy; text-underline-offset: 4px; }

/* "reset email sent" notice on the forgot-password page */
html[data-m2="auth"] .card-glass .bg-green-50 {
  border: 3px solid var(--m2-line);
  border-radius: 22px;
  background: var(--m2-mint);
}
html[data-m2="auth"] .card-glass .bg-green-50 :is(h3, p, svg) { color: var(--m2-ink); }
html[data-m2="auth"] .card-glass .bg-green-50 .rounded-full { border: 3px solid var(--m2-line); background: #fff; }

/* promo panel, desktop only; hidden by its [hidden] attribute everywhere else */
.m2-aside {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1;
  width: 46vw;
  flex-direction: column;
  padding: 2rem clamp(1.5rem, 4vw, 3.5rem);
  overflow: hidden;
  border-right: 3px solid var(--m2-line);
  background: var(--m2-pink-soft) radial-gradient(rgb(255 143 179 / .3) 3px, transparent 3.5px) 0 0 / 34px 34px;
  color: var(--m2-text);
  font-family: var(--m2-font);
}
.m2-aside-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.5rem; text-align: center; }
.m2-aside .m2-bubble { max-width: 25rem; padding: 1rem 1.5rem; border-radius: 28px; }
.m2-aside-title { font-size: clamp(1.8rem, 2.6vw, 2.5rem); font-weight: 700; line-height: 1.1; }
.m2-aside-text { margin-top: .35rem; color: var(--m2-muted); font-size: 1.1rem; font-weight: 400; line-height: 1.45; }
.m2-aside-mimi { width: min(290px, 36vh); height: auto; }
/* the mascot's dark outline disappears on dark surfaces, so give it a sticker edge */
html.dark[data-m2="auth"] .m2-aside-mimi,
html.dark[data-m2="auth"] .card-glass::before {
  filter: drop-shadow(2px 0 0 #fff3e6) drop-shadow(-2px 0 0 #fff3e6) drop-shadow(0 2px 0 #fff3e6) drop-shadow(0 -2px 0 #fff3e6);
}
.m2-aside-list { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; max-width: 30rem; }
.m2-aside-list li {
  padding: .35rem 1rem;
  border: 3px solid var(--m2-line);
  border-radius: 999px;
  background: var(--m2-card);
  font-weight: 500;
  box-shadow: 0 3px 0 var(--m2-line);
}

@media (min-width: 1024px) {
  html[data-m2="auth"] .m2-aside { display: flex; }
  html[data-m2="auth"] #app > .min-h-screen { padding-left: calc(46vw + 1rem); }
  html[data-m2="auth"] #app > .min-h-screen > .z-10 > .mb-8 { display: none; }
}
