/* ==========================================================================
   Keyline Auth Starter Kit — auth screens
   Split layout, highlight panel, OTP input, plan picker, status screens.
   ========================================================================== */

.auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(420px, 46%) 1fr;
}

/* ---------- Highlight panel (left) ---------- */
.auth-aside {
  position: relative;
  margin: 16px 0 16px 16px;
  border-radius: var(--kl-r-xl);
  background: var(--kl-forest);
  color: #DCEBE1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 36px 40px 32px;
  isolation: isolate;
}

.aside-rings {
  position: absolute;
  right: -180px;
  bottom: -220px;
  width: 640px;
  height: 640px;
  z-index: -1;
  pointer-events: none;
}

.aside-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .9rem;
  color: #9FBFAB;
}
.aside-top strong { color: #fff; font-weight: 600; }
.aside-top .live { display: inline-flex; align-items: center; gap: .45rem; }
.aside-top .live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--kl-brand); box-shadow: 0 0 0 4px rgba(74, 221, 130, .18); }

.slides { position: relative; flex: 1; display: grid; margin-top: 12px; }
.slide {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .45s ease, transform .45s ease, visibility 0s linear .45s;
}
.slide.is-active { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }

.slide__stage {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 300px;
  padding: 24px 0;
  position: relative;
}
.slide__title {
  font-size: clamp(1.6rem, 2.2vw, 2.1rem);
  font-weight: 600;
  color: #fff;
  max-width: 20ch;
  margin: 0 0 .6rem;
}
.slide__text { color: #A9C5B3; max-width: 46ch; margin: 0; font-size: 1rem; }

.aside-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
}
.dots { display: flex; gap: 6px; }
.dots button {
  width: 26px;
  height: 6px;
  border: 0;
  padding: 0;
  border-radius: 6px;
  background: rgba(220, 235, 225, .25);
  transition: width .25s ease, background-color .25s ease;
}
.dots button[aria-current="true"] { width: 44px; background: var(--kl-brand); }
.arrows { display: flex; gap: 6px; }
.arrows button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(220, 235, 225, .22);
  background: transparent;
  color: #DCEBE1;
  display: grid;
  place-items: center;
}
.arrows button:hover { background: rgba(220, 235, 225, .08); }

/* Mock product cards inside the panel */
.mock-wrap { position: relative; width: min(340px, 100%); }
.mock {
  position: relative;
  width: 100%;
  background: #fff;
  color: var(--kl-ink);
  border-radius: var(--kl-r-lg);
  padding: 18px;
  box-shadow: 0 30px 60px -25px rgba(0, 0, 0, .55);
  font-size: .88rem;
}
.mock-back {
  position: absolute;
  inset: 0;
  border-radius: var(--kl-r-lg);
  background: var(--kl-forest-2);
  transform: rotate(-5deg) translate(-14px, 12px);
}
.mock__head { display: flex; gap: .7rem; align-items: center; margin-bottom: .9rem; }
.mock__icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--kl-brand-soft);
  color: #17804A;
  font-size: 1.1rem;
  flex: none;
}
.mock__head strong { display: block; font-size: .95rem; }
.mock__head span { color: var(--kl-muted); font-size: .8rem; }
.mock dl { display: grid; grid-template-columns: auto 1fr; gap: .35rem .9rem; margin: 0 0 1rem; }
.mock dt { color: var(--kl-muted); font-weight: 400; }
.mock dd { margin: 0; font-weight: 500; }
.mock__actions { display: flex; gap: .5rem; }
.mock__actions span {
  flex: 1;
  text-align: center;
  padding: .5rem;
  border-radius: var(--kl-r-sm);
  font-weight: 600;
  font-size: .82rem;
}
.mock__actions .yes { background: var(--kl-brand); color: var(--kl-on-brand); }
.mock__actions .no { border: 1px solid var(--kl-line-strong); }

.mock-code { display: flex; gap: 6px; margin: .3rem 0 .8rem; }
.mock-code span {
  flex: 1;
  height: 48px;
  border: 1.5px solid var(--kl-line);
  border-radius: var(--kl-r-sm);
  display: grid; place-items: center;
  font-family: var(--kl-font-display);
  font-size: 1.35rem;
  font-weight: 700;
}
.mock-code span.on { border-color: #2FBC65; box-shadow: 0 0 0 3px rgba(74, 221, 130, .25); }
.mock-code span.gap { flex: .35; border: 0; }
.mock__foot { display: flex; justify-content: space-between; color: var(--kl-muted); font-size: .8rem; }

.device-list { list-style: none; margin: 0; padding: 0; }
.device-list li { display: flex; align-items: center; gap: .7rem; padding: .6rem 0; border-top: 1px solid var(--kl-line); }
.device-list li:first-child { border-top: 0; padding-top: 0; }
.device-list i { font-size: 1.2rem; color: var(--kl-ink-2); }
.device-list div { flex: 1; line-height: 1.3; }
.device-list small { color: var(--kl-muted); }
.tag {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  padding: .15rem .5rem;
  border-radius: 999px;
  background: var(--kl-brand-soft);
  color: #17804A;
}
.tag--muted { background: #EEF1EF; color: var(--kl-muted); }

/* ---------- Main column (right) ---------- */
.auth-main {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  padding: 28px clamp(20px, 5vw, 64px) 22px;
}

.auth-top { display: flex; align-items: center; justify-content: space-between; }

.home-link {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .9rem;
  font-weight: 600;
  color: var(--kl-ink-2);
  text-decoration: none;
  padding: .45rem .8rem;
  border-radius: 999px;
  border: 1px solid var(--kl-line);
  background: #fff;
}
.home-link:hover { color: var(--kl-ink); border-color: var(--kl-line-strong); }

.auth-body { display: flex; align-items: center; justify-content: center; padding: 40px 0; }
.auth-card { width: 100%; max-width: 420px; }

.auth-title { font-size: clamp(1.85rem, 3vw, 2.3rem); font-weight: 700; margin: 0 0 .45rem; }
.auth-sub { color: var(--kl-muted); margin: 0 0 1.6rem; max-width: 40ch; }
.auth-sub strong { color: var(--kl-ink); font-weight: 600; overflow-wrap: anywhere; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .9rem;
  font-weight: 600;
  color: var(--kl-ink-2);
  text-decoration: none;
  margin-bottom: 1.6rem;
}
.back-link:hover { color: var(--kl-ink); }

/* Segmented control (Sign in / Create account) */
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  background: #E5ECE7;
  border-radius: 12px;
  margin-bottom: 1.6rem;
}
.seg a {
  text-align: center;
  padding: .55rem .5rem;
  border-radius: 9px;
  font-size: .93rem;
  font-weight: 600;
  color: var(--kl-muted);
  text-decoration: none;
}
.seg a:hover { color: var(--kl-ink); }
.seg a[aria-current="page"] { background: #fff; color: var(--kl-ink); box-shadow: 0 1px 2px rgba(14, 42, 28, .12), 0 0 0 1px rgba(14, 42, 28, .04); }

.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.3rem; }

.auth-alt { margin: 1.4rem 0 0; font-size: .93rem; color: var(--kl-muted); }
.auth-alt a { font-weight: 600; }

.auth-foot { padding-top: 12px; }

/* ---------- Plan picker (register) ---------- */
.plans { display: grid; gap: .5rem; border: 0; padding: 0; margin: 0 0 1.2rem; }
.plans legend { font-size: .9rem; font-weight: 600; color: var(--kl-ink-2); margin-bottom: .4rem; }
.plan { position: relative; display: block; cursor: pointer; margin: 0; }
.plan input { position: absolute; opacity: 0; pointer-events: none; }
.plan__body {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .8rem;
  padding: .75rem .9rem;
  border: 1.5px solid var(--kl-line);
  border-radius: var(--kl-r);
  background: #fff;
  transition: border-color .15s ease, background-color .15s ease;
}
.plan__radio { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--kl-line-strong); display: grid; place-items: center; }
.plan__name { font-weight: 600; line-height: 1.25; }
.plan__name small { display: block; font-weight: 400; font-size: .82rem; color: var(--kl-muted); }
.plan__price { font-family: var(--kl-font-display); font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.plan__price small { font-family: var(--kl-font-body); font-weight: 400; font-size: .78rem; color: var(--kl-muted); }
.plan:hover .plan__body { border-color: var(--kl-line-strong); }
.plan input:checked + .plan__body { border-color: #2FBC65; background: #F5FDF8; }
.plan input:checked + .plan__body .plan__radio { border-color: #2FBC65; }
.plan input:checked + .plan__body .plan__radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #22A957; }
.plan input:focus-visible + .plan__body { box-shadow: 0 0 0 4px rgba(74, 221, 130, .3); }

/* ---------- OTP ---------- */
.otp { display: grid; grid-template-columns: repeat(3, 1fr) 14px repeat(3, 1fr); gap: 8px; margin-bottom: .6rem; }
.otp .otp-sep { align-self: center; height: 2px; background: var(--kl-line-strong); border-radius: 2px; }
.otp input {
  width: 100%;
  height: 58px;
  text-align: center;
  font-family: var(--kl-font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--kl-ink);
  border: 1.5px solid var(--kl-line);
  border-radius: var(--kl-r);
  background: #fff;
  caret-color: #22A957;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.otp input:focus { outline: none; border-color: #2FBC65; box-shadow: 0 0 0 4px rgba(74, 221, 130, .22); }
.otp input.is-filled { border-color: var(--kl-line-strong); }
.otp input:disabled { background: #F0F3F1; color: var(--kl-muted); }
.otp.is-invalid input { border-color: var(--kl-danger); }
.otp.is-invalid { animation: shake .32s ease; }
@keyframes shake {
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}
.otp-meta { display: flex; justify-content: space-between; align-items: center; font-size: .88rem; color: var(--kl-muted); margin-bottom: 1.3rem; min-height: 1.4em; }
.otp-meta .expired { color: var(--kl-danger); }

/* ---------- Status screens (verify email, verified, expired) ---------- */
.status-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  margin-bottom: 1.4rem;
  background: var(--kl-brand-soft);
  color: #17804A;
}
.status-icon--warn { background: var(--kl-warn-soft); color: var(--kl-warn); }
.status-icon--danger { background: var(--kl-danger-soft); color: var(--kl-danger); }

.steps-note {
  list-style: none;
  padding: 0;
  margin: 0 0 1.6rem;
  border-top: 1px solid var(--kl-line);
}
.steps-note li { display: flex; gap: .7rem; padding: .75rem 0; border-bottom: 1px solid var(--kl-line); font-size: .93rem; color: var(--kl-ink-2); }
.steps-note i { color: var(--kl-muted); font-size: 1.05rem; }

.stack-actions { display: grid; gap: .6rem; }

[data-state] { display: none; }
[data-state].is-shown { display: block; }

/* ---------- Responsive ---------- */
@media (max-width: 1199.98px) {
  .auth-shell { grid-template-columns: minmax(380px, 42%) 1fr; }
  .auth-aside { padding: 30px 30px 26px; }
}

@media (max-width: 991.98px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-body { align-items: flex-start; padding: 32px 0; }
}

@media (max-width: 575.98px) {
  .auth-main { padding: 18px 18px 18px; }
  .home-link span { display: none; }
  .home-link { padding: .5rem .6rem; }
  .otp { gap: 6px; grid-template-columns: repeat(3, 1fr) 8px repeat(3, 1fr); }
  .otp input { height: 52px; font-size: 1.35rem; }
  .checklist { grid-template-columns: 1fr; }
}

@media (min-height: 980px) and (min-width: 992px) {
  .slide__stage { min-height: 380px; }
}

/* Keep the demo inbox over the highlight panel on wide screens, away from the form */
@media (min-width: 992px) {
  .demo-inbox { right: auto; left: 32px; bottom: 32px; }
}
