/*
 * Sign-in / create-account page. The form lives on the primary golden
 * wood sign; the grove canvas fills the page behind it.
 */

.auth-grove {
  min-height: 100svh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--kw-next-character-grove) center / cover no-repeat #cbe9bd;
}

/*
 * The golden sign art has feathered transparent edges (about 8% on top,
 * 20% of soft moss shadow at the bottom), so the padding keeps every
 * line of text on the solid plank.
 */
.auth-board {
  position: relative;
  z-index: 3;
  display: flex;
  width: min(34rem, 100%);
  flex-direction: column;
  padding: 3rem;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 211, 95, 0.26), rgba(255, 211, 95, 0) 34%),
    linear-gradient(180deg, rgba(255, 253, 244, 0.98), rgba(244, 249, 228, 0.94));
  border: 0.12rem solid rgba(83, 66, 38, 0.24);
  border-radius: 1rem;
  box-shadow: 0 0.5rem 0.9rem rgba(20, 48, 30, 0.18);
  isolation: isolate;
  text-align: center;
}

.auth-extra {
  position: relative;
  z-index: 3;
  display: grid;
  gap: 0.55rem;
  justify-items: center;
  width: min(26rem, 100%);
  margin-top: 1.1rem;
  text-align: center;
}

.auth-board .eyebrow {
  color: #1d6a44;
  letter-spacing: 0.08em;
}

.auth-board h1 {
  margin: 0 auto;
  max-width: 90%;
  color: var(--forest-ink);
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  line-height: 1.1;
  text-wrap: balance;
}

.auth-board > p {
  margin: 0.5rem auto 0;
  max-width: min(20rem, 84%);
  color: #162f22;
  font-weight: 700;
  font-size: clamp(1rem, 1.8vw, 1.06rem);
  line-height: 1.55;
}

.auth-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin: 0.9rem 0 0.7rem;
}

.auth-mode .leaf-badge {
  min-width: 8.4rem;
  border: 0.08rem solid rgba(83, 66, 38, 0.18);
  border-radius: 999px;
  background: #fff7dc;
  opacity: 1;
  filter: none;
  text-shadow: none;
}

.auth-mode .leaf-badge.is-active {
  color: #fffdf4;
  background: #24784a;
  border-color: #17683c;
  filter: none;
}

.auth-mode .leaf-badge:hover {
  background: #ffeaa6;
  filter: none;
}

.plan-notice {
  display: none;
  margin: 0.3rem auto 0.5rem;
  padding: 0.55rem 0.9rem 0.65rem;
  max-width: 24rem;
  background: var(--kw-ui-leaf-badge) center / 100% 100% no-repeat;
  color: #1d4631;
  font-weight: 900;
  font-size: 0.85rem;
  line-height: 1.25;
}

.plan-notice.is-visible {
  display: block;
}

.auth-form {
  display: grid;
  gap: 0.62rem;
  width: min(22rem, 100%);
  margin: 0.4rem auto 0;
  text-align: left;
}

.auth-form .wood-button {
  justify-self: center;
  min-width: 12rem;
  margin-top: 0.35rem;
}

.auth-footnote {
  margin: 0 auto;
  max-width: 22rem;
  color: #0f2a1c;
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.38;
  text-shadow: 0 1px 0 rgba(255, 246, 205, 0.6);
}

.auth-board .auth-footnote {
  margin-top: 0.85rem;
  color: #5a3b1a;
  text-shadow: none;
}

.auth-back {
  margin-top: 1.1rem;
}

@media (max-width: 720px) {
  .auth-board {
    width: min(26rem, 100%);
    padding: 2.35rem 1.2rem 4.5rem;
    background-size: cover;
    border-radius: 1rem;
    overflow: hidden;
  }

  .auth-board::before {
    inset: 12% 5% 14%;
    background: rgba(255, 244, 196, 0.42);
  }

  .auth-board h1 {
    max-width: 100%;
    font-size: clamp(1.65rem, 7vw, 2.25rem);
  }

  .auth-board > p {
    max-width: 100%;
    font-size: 0.92rem;
  }

  .auth-mode .leaf-badge {
    min-width: min(8.2rem, 46%);
  }

  .auth-extra {
    margin-top: 0.85rem;
  }
}

/* ---------- unified forest-material auth skin ---------- */

.auth-board {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(255, 226, 154, 0.44), rgba(255, 226, 154, 0) 44%),
    linear-gradient(180deg, var(--surface-paper-strong), var(--surface-paper) 60%, var(--surface-moss));
  border-color: var(--surface-border);
  border-radius: 0.72rem;
  box-shadow:
    inset 0 0.08rem 0 rgba(255, 255, 255, 0.65),
    var(--surface-shadow);
}

.auth-board .eyebrow,
.plan-notice {
  color: var(--moss-700);
}

.auth-board h1 {
  color: var(--canopy-900);
}

.auth-board > p,
.auth-footnote {
  color: var(--forest-text);
}

.auth-mode .leaf-badge {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 232, 163, 0.44), rgba(255, 232, 163, 0) 48%),
    linear-gradient(180deg, var(--paper-50), var(--paper-100));
  border-color: rgba(91, 50, 24, 0.34);
  color: var(--canopy-900);
}

.auth-mode .leaf-badge:hover {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 232, 163, 0.44), rgba(255, 232, 163, 0) 48%),
    linear-gradient(180deg, var(--meadow-100), #d8ebb9);
}

.auth-mode .leaf-badge.is-active {
  background: linear-gradient(180deg, var(--moss-600), var(--moss-700));
  border-color: var(--canopy-800);
  color: #fff8dc;
}

.plan-notice {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 232, 163, 0.4), rgba(255, 232, 163, 0) 50%),
    linear-gradient(180deg, var(--meadow-100), #d8ebb9);
  border: 0.08rem solid rgba(67, 101, 52, 0.34);
  border-radius: 999px;
}

/* ---------- dark storybook auth pass ---------- */

.auth-grove {
  background:
    radial-gradient(circle at 72% 8%, rgba(105, 78, 158, 0.22), transparent 24rem),
    linear-gradient(180deg, var(--kw-story-night), #0f0d20);
}

.auth-grove .asset-layer {
  opacity: 0.16;
  filter: saturate(0.55) brightness(0.72);
}

.auth-board,
.auth-mode .leaf-badge,
.plan-notice,
.auth-form .field {
  background: var(--kw-story-panel);
  border-color: var(--kw-story-line);
  color: var(--kw-story-text);
  box-shadow: none;
}

.auth-board h1,
.auth-board .eyebrow,
.auth-form .field span {
  color: #fff;
}

.auth-board > p,
.auth-footnote,
.auth-board .auth-footnote {
  color: var(--kw-story-muted);
}

.auth-mode .leaf-badge {
  color: var(--kw-story-muted);
}

.auth-mode .leaf-badge:hover,
.auth-mode .leaf-badge.is-active {
  background: var(--kw-story-cream);
  border-color: var(--kw-story-cream);
  color: #171326;
}

.auth-form input {
  background: #222033;
  border-color: #4b4563;
  color: #fff;
}

.auth-form .wood-button,
.auth-extra .wood-button {
  background: var(--kw-story-cream);
  border: 0;
  color: #171326;
  text-shadow: none;
  box-shadow: none;
}

.auth-extra .wood-button.is-quiet {
  background: #38354d;
  border: 0.06rem solid #57516f;
  color: #f7f3ff;
}
