/* Ledoly authentication — purple storybook edition */
.auth-story-page {
  --auth-ink: #35284f;
  --auth-page: #f7f1e4;
  --auth-paper: #fff9e9;
  --auth-paper-strong: #fff2bd;
  --auth-purple: rgb(var(--lg-accent, 108 92 231));
  --auth-purple-deep: #5747d7;
  --auth-purple-soft: #eee9ff;
  --auth-green: #daf3d3;
  --auth-pink: #ffe0e9;
  --auth-muted: #665d78;
  --auth-shadow: #c8bdd2;
  --auth-google: #fffdf7;
  --auth-google-text: #2f2840;
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  padding: clamp(1rem, 3vw, 2.5rem);
  color: var(--auth-ink);
  background-color: var(--auth-page);
  background-image:
    linear-gradient(rgba(53, 40, 79, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(53, 40, 79, .055) 1px, transparent 1px);
  background-size: 40px 40px;
  font-family: "Be Vietnam Pro", sans-serif;
}

.dark .auth-story-page,
[data-theme="dark"] .auth-story-page {
  --auth-ink: #fff1d2;
  --auth-page: #191522;
  --auth-paper: #2c253c;
  --auth-paper-strong: #4a3b54;
  --auth-purple: #8d7af6;
  --auth-purple-deep: #745ee9;
  --auth-purple-soft: #463a70;
  --auth-green: #284638;
  --auth-pink: #563241;
  --auth-muted: #d5cbe4;
  --auth-shadow: #0d0914;
  --auth-google: #fff7e7;
  --auth-google-text: #2f2840;
  background-image:
    linear-gradient(rgba(255, 241, 210, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 241, 210, .055) 1px, transparent 1px);
}

.auth-story-page::before,
.auth-story-page::after {
  content: "";
  position: fixed;
  z-index: 0;
  pointer-events: none;
}

.auth-story-page::before {
  top: 6%;
  left: 4%;
  width: 68px;
  height: 68px;
  border: 4px solid var(--auth-purple);
  border-radius: 22px 15px 24px 13px;
  opacity: .24;
  transform: rotate(16deg);
}

.auth-story-page::after {
  right: 5%;
  bottom: 8%;
  width: 120px;
  height: 55px;
  border: 4px solid var(--auth-purple);
  border-right-color: transparent;
  border-left-color: transparent;
  border-radius: 50%;
  opacity: .2;
  transform: rotate(-12deg);
}

.auth-theme-toggle-wrap {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 50;
}

.auth-story-page .theme-toggle {
  width: 46px;
  height: 46px;
  border: 2.5px solid var(--auth-ink);
  border-radius: 15px 11px 16px 10px;
  color: var(--auth-ink);
  background: var(--auth-paper-strong);
  box-shadow: 3px 4px 0 var(--auth-ink);
  transition: transform .15s ease, box-shadow .15s ease;
}

.auth-story-page .theme-toggle:hover {
  transform: translate(-1px, -2px) rotate(-2deg);
  box-shadow: 5px 6px 0 var(--auth-ink);
}

.auth-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(330px, .9fr) minmax(410px, 1.1fr);
  gap: clamp(1rem, 2.5vw, 2rem);
  width: min(1080px, 100%);
  margin: auto;
  align-items: stretch;
}

.auth-scene,
.auth-card {
  border: 3px solid var(--auth-ink);
  box-shadow: 7px 8px 0 var(--auth-shadow);
}

.auth-scene {
  position: relative;
  display: flex;
  min-height: 690px;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(1.35rem, 3vw, 2.25rem);
  color: #fff9e9;
  border-radius: 36px 25px 33px 22px / 27px 38px 24px 34px;
  background: var(--auth-paper);
  background:
    radial-gradient(circle at 78% 18%, rgba(255, 242, 189, .28) 0 4px, transparent 5px),
    radial-gradient(circle at 14% 72%, rgba(255, 255, 255, .18) 0 3px, transparent 4px),
    linear-gradient(145deg, var(--auth-purple) 0%, var(--auth-purple-deep) 100%);
  background-size: 34px 34px, 28px 28px, auto;
  transform: rotate(-.35deg);
}

.auth-scene::before {
  content: "";
  position: absolute;
  right: -42px;
  bottom: -45px;
  width: 190px;
  height: 190px;
  border: 4px solid rgba(255, 249, 233, .38);
  border-radius: 48% 52% 44% 56%;
  transform: rotate(18deg);
}

.auth-scene::after {
  content: "";
  position: absolute;
  left: -20px;
  top: 31%;
  width: 90px;
  height: 34px;
  border-top: 4px solid rgba(255, 249, 233, .34);
  border-bottom: 4px solid rgba(255, 249, 233, .34);
  border-radius: 50%;
  transform: rotate(9deg);
}

.auth-scene-brand {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: .7rem;
  padding: .45rem .7rem .45rem .5rem;
  border: 2px solid #35284f;
  border-radius: 14px 11px 16px 10px;
  color: #35284f;
  background: #fff9e9;
  box-shadow: 3px 4px 0 #35284f;
  font-family: "Baloo 2", sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
  transform: rotate(-1deg);
}

.auth-scene-brand img {
  width: 32px;
  height: 32px;
  border: 2px solid #35284f;
  border-radius: 10px 7px 11px 6px;
}

.auth-scene-copy { margin-top: clamp(1.35rem, 4vh, 2.5rem); }
.auth-scene-eyebrow {
  display: block;
  margin-bottom: .45rem;
  color: #fff2bd;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.auth-scene-title {
  max-width: 390px;
  margin: 0;
  font-family: "Baloo 2", "Be Vietnam Pro", sans-serif;
  font-size: clamp(2.15rem, 4vw, 3.45rem);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: .96;
}
.auth-scene-lede {
  max-width: 390px;
  margin: .75rem 0 0;
  color: rgba(255, 249, 233, .88);
  font-size: .9rem;
  line-height: 1.65;
}

.auth-mascot-stage {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(130px, 1fr);
  align-items: center;
  gap: .35rem;
  margin: auto 0 .65rem;
  min-height: 190px;
}

.auth-mascot-stage .doly-auth { margin: 0; }
.auth-mascot-stage .doly { --doly-size: 176px !important; }

.auth-mascot-speech {
  position: relative;
  z-index: 2;
  max-width: 210px;
  padding: .85rem 1rem;
  border: 3px solid #35284f;
  border-radius: 20px 24px 18px 26px;
  color: #35284f;
  background: #fff9e9;
  box-shadow: 4px 5px 0 #35284f;
  font-family: "Baloo 2", "Be Vietnam Pro", sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
  transform: rotate(1.5deg);
}

.auth-mascot-speech::before {
  content: "";
  position: absolute;
  left: -11px;
  bottom: 22px;
  width: 18px;
  height: 18px;
  border-left: 3px solid #35284f;
  border-bottom: 3px solid #35284f;
  background: #fff9e9;
  transform: rotate(45deg);
}

.auth-scene-chips {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}
.auth-scene-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem .65rem;
  border: 2px solid #35284f;
  border-radius: 999px;
  color: #35284f;
  background: #fff2bd;
  box-shadow: 2px 3px 0 #35284f;
  font-size: .66rem;
  font-weight: 800;
}
.auth-scene-chip:nth-child(2) { background: #daf3d3; transform: rotate(1deg); }
.auth-scene-chip:nth-child(3) { background: #ffe0e9; transform: rotate(-1deg); }
.auth-scene-chip svg { width: 15px; height: 15px; color: #6c5ce7; }

.auth-card {
  position: relative;
  align-self: center;
  width: 100%;
  padding: clamp(1.25rem, 3.2vw, 2.35rem);
  border-radius: 27px 34px 24px 31px / 33px 25px 36px 23px;
  background:
    radial-gradient(circle at 91% 9%, color-mix(in srgb, var(--auth-paper-strong) 74%, transparent) 0 22px, transparent 23px),
    var(--auth-paper);
  transform: rotate(.2deg);
}

.auth-card::before,
.auth-card::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.auth-card::before {
  top: 15px;
  left: 18px;
  width: 19px;
  height: 19px;
  border: 3px solid var(--auth-purple);
  border-radius: 7px 4px 8px 5px;
  transform: rotate(-15deg);
  opacity: .55;
}
.auth-card::after {
  right: 22px;
  bottom: 18px;
  width: 42px;
  height: 14px;
  border-top: 3px solid var(--auth-purple);
  border-radius: 50%;
  transform: rotate(-8deg);
  opacity: .45;
}

.auth-card-header { margin-bottom: 1.25rem !important; }
.auth-logo-sticker {
  width: 58px !important;
  height: 58px !important;
  margin-bottom: .65rem !important;
  border: 2.5px solid var(--auth-ink);
  border-radius: 17px 12px 18px 11px !important;
  box-shadow: 3px 4px 0 var(--auth-shadow);
  transform: rotate(-2deg);
}
.auth-card-title {
  margin: 0;
  font-family: "Baloo 2", "Be Vietnam Pro", sans-serif;
  font-size: clamp(1.75rem, 4vw, 2.25rem) !important;
  font-weight: 800 !important;
  line-height: 1;
}
.auth-card-subtitle { max-width: 390px; margin: .45rem auto 0 !important; color: var(--auth-muted) !important; line-height: 1.55; }

.auth-tabs {
  gap: .35rem;
  padding: .32rem !important;
  border: 2.5px solid var(--auth-ink) !important;
  border-radius: 16px 12px 18px 11px !important;
  background: var(--auth-purple-soft) !important;
  box-shadow: 3px 4px 0 var(--auth-shadow);
}
.auth-tab {
  border: 2px solid transparent;
  border-radius: 12px 9px 13px 8px !important;
  font-weight: 800 !important;
}
.auth-tab.is-active {
  border-color: var(--auth-ink);
  background: var(--auth-purple) !important;
  box-shadow: 2px 2px 0 var(--auth-ink);
}

.auth-google {
  min-height: 50px;
  border: 2.5px solid var(--auth-ink) !important;
  border-radius: 15px 11px 17px 10px !important;
  color: var(--auth-google-text) !important;
  background: var(--auth-google) !important;
  box-shadow: 3px 4px 0 var(--auth-shadow);
  font-weight: 800 !important;
}
.auth-google:hover { transform: translate(-1px, -1px) rotate(-.2deg); box-shadow: 4px 5px 0 var(--auth-ink) !important; }

.auth-divider { margin: 1.1rem 0 !important; }
.auth-divider div { height: 2px !important; background: var(--auth-ink) !important; opacity: .26; }
.auth-divider span {
  display: grid;
  width: 34px;
  height: 29px;
  place-items: center;
  border: 2px solid var(--auth-ink);
  border-radius: 9px 6px 10px 5px;
  color: var(--auth-ink) !important;
  background: var(--auth-paper-strong);
  transform: rotate(-3deg);
}

.auth-form { position: relative; z-index: 1; }
.auth-form > div:not(.auth-options) { position: relative; }
.auth-card label[for^="auth-"],
.auth-card label[for^="reset-"],
.auth-card label[for="forgot-email"] {
  color: var(--auth-ink) !important;
  font-size: .73rem !important;
  font-weight: 800 !important;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
  min-height: 52px;
  border: 2.5px solid var(--auth-ink) !important;
  border-radius: 15px 11px 17px 10px !important;
  color: var(--auth-ink) !important;
  background: var(--auth-paper) !important;
  box-shadow: 3px 4px 0 var(--auth-shadow);
  font-weight: 600;
}
.auth-form input[type="text"]::placeholder,
.auth-form input[type="email"]::placeholder,
.auth-form input[type="password"]::placeholder { color: var(--auth-muted) !important; opacity: .72; }
.auth-form input[type="text"]:focus,
.auth-form input[type="email"]:focus,
.auth-form input[type="password"]:focus {
  border-color: var(--auth-purple) !important;
  outline: 3px solid color-mix(in srgb, var(--auth-purple) 26%, transparent) !important;
  outline-offset: 2px;
  box-shadow: 4px 5px 0 var(--auth-ink);
}

.auth-form input[type="checkbox"] {
  width: 20px !important;
  height: 20px !important;
  flex: 0 0 auto;
  border: 2px solid var(--auth-ink) !important;
  border-radius: 6px 4px 7px 3px !important;
  accent-color: var(--auth-purple);
}
.auth-options { align-items: flex-start; }
.auth-options label { color: var(--auth-muted) !important; font-size: .76rem !important; line-height: 1.45; }

.auth-submit,
.auth-inline-button {
  min-height: 52px;
  border: 2.5px solid var(--auth-ink) !important;
  border-radius: 16px 11px 18px 10px !important;
  color: #fff !important;
  background: var(--auth-purple) !important;
  box-shadow: 4px 5px 0 var(--auth-ink);
  font-family: "Baloo 2", "Be Vietnam Pro", sans-serif;
  font-size: 1.05rem !important;
  font-weight: 800 !important;
  transition: transform .15s ease, box-shadow .15s ease;
}
.auth-submit:hover,
.auth-inline-button:hover { opacity: 1 !important; transform: translate(-1px, -2px) rotate(-.25deg); box-shadow: 6px 7px 0 var(--auth-ink); }
.auth-submit:active,
.auth-inline-button:active { transform: translate(2px, 3px); box-shadow: 1px 2px 0 var(--auth-ink); }

.auth-alert {
  border: 2.5px solid var(--auth-ink) !important;
  border-radius: 16px 11px 18px 10px !important;
  color: var(--auth-ink) !important;
  background: var(--auth-pink) !important;
  box-shadow: 3px 4px 0 var(--auth-shadow);
  font-weight: 700;
}
.auth-alert.is-success { background: var(--auth-green) !important; }
.auth-inline-card {
  border: 2.5px solid var(--auth-ink) !important;
  border-radius: 19px 14px 21px 13px !important;
  color: var(--auth-ink);
  background: var(--auth-paper-strong) !important;
  box-shadow: 4px 5px 0 var(--auth-shadow);
}
.auth-inline-card p { color: var(--auth-muted) !important; }

.auth-card a:not(.auth-google):not(.auth-tab):not(.auth-inline-button) {
  color: var(--auth-purple) !important;
  font-weight: 800;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.auth-switch { margin-top: 1.35rem !important; color: var(--auth-muted) !important; }
.auth-home { margin-top: .7rem !important; }
.auth-home-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: .4rem;
  color: var(--auth-muted) !important;
}

.auth-card a:focus-visible,
.auth-card button:focus-visible,
.auth-story-page .theme-toggle:focus-visible {
  outline: 3px solid var(--auth-purple) !important;
  outline-offset: 4px !important;
}

@media (max-width: 900px) {
  .auth-story-page { align-items: flex-start !important; }
  .auth-shell {
    grid-template-columns: 1fr;
    width: min(590px, 100%);
    margin: 1.5rem auto;
  }
  .auth-scene {
    min-height: 330px;
    padding: 1.25rem;
    transform: rotate(-.2deg);
  }
  .auth-scene-copy { margin-top: 1rem; padding-right: 145px; }
  .auth-scene-title { font-size: clamp(2rem, 7vw, 2.7rem); }
  .auth-scene-lede { display: none; }
  .auth-mascot-stage {
    position: absolute;
    right: 1rem;
    top: 74px;
    display: block;
    min-height: 0;
    margin: 0;
  }
  .auth-mascot-stage .doly { --doly-size: 145px !important; }
  .auth-mascot-speech { max-width: 155px; margin: -10px 7px 0 auto; padding: .55rem .7rem; font-size: .82rem; }
  .auth-mascot-speech::before { display: none; }
  .auth-scene-chips { margin-top: auto; max-width: calc(100% - 120px); }
  .auth-card { align-self: stretch; transform: rotate(.1deg); }
}

@media (max-width: 560px) {
  .auth-story-page { padding: .75rem; }
  .auth-theme-toggle-wrap { top: .75rem; right: .75rem; }
  .auth-story-page .theme-toggle { width: 42px; height: 42px; }
  .auth-shell { margin: 3rem auto 1rem; gap: .8rem; }
  .auth-scene,
  .auth-card { border-width: 2.5px; box-shadow: 4px 5px 0 var(--auth-shadow); }
  .auth-scene { min-height: 285px; border-radius: 25px 18px 28px 16px; }
  .auth-scene-copy { padding-right: 118px; }
  .auth-scene-title { font-size: 1.85rem; }
  .auth-scene-eyebrow { font-size: .61rem; }
  .auth-mascot-stage { right: .4rem; top: 76px; }
  .auth-mascot-stage .doly { --doly-size: 120px !important; }
  .auth-mascot-speech { max-width: 125px; font-size: .68rem; margin-top: .2rem; }
  .auth-scene-chips { max-width: 200px; gap: .4rem; }
  .auth-scene-chip { padding: .38rem .5rem; font-size: .58rem; }
  .auth-scene-chip:nth-child(3) { display: none; }
  .auth-card { padding: 1.15rem; border-radius: 22px 27px 20px 25px; }
  .auth-card::before { top: 11px; left: 12px; width: 14px; height: 14px; }
  .auth-logo-sticker { width: 50px !important; height: 50px !important; }
  .auth-card-title { font-size: 1.75rem !important; }
  .auth-card-subtitle { font-size: .75rem !important; }
  .auth-options { flex-direction: column; gap: .7rem !important; }
  .auth-submit { min-height: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-scene,
  .auth-card,
  .auth-scene-brand,
  .auth-scene-chip,
  .auth-mascot-speech { transform: none !important; }
  .auth-story-page .theme-toggle,
  .auth-submit,
  .auth-inline-button { transition: none; }
}
