/* ==========================================================================
   Thamra — sign-in surface
   Split layout: a dark stage carrying the product's core object (the lead
   card) beside the form. Collapses to a single column below 900px.
   ========================================================================== */

.auth {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 900px) {
  .auth {
    grid-template-columns: 1fr;
  }
}

/* ---------- stage (left) ---------- */

.stage {
  position: relative;
  overflow: hidden;
  /* Always dark, in both themes — and a shade deeper than the dark ground so
     the split still reads when the rest of the page is dark too. */
  background: #090e0c;
  border-right: 1px solid #1e2724;
  color: #e8eeeb;
  padding: 44px 48px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

@media (max-width: 900px) {
  .stage {
    display: none;
  }
}

/* A faint hall-floor grid — the surface the product actually lives on. */
.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(43, 167, 124, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43, 167, 124, 0.07) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(120% 90% at 20% 0%, #000 30%, transparent 78%);
  pointer-events: none;
}

.stage > * {
  position: relative;
}

.stage .brand__mark {
  background: #2ba77c;
  color: #06120d;
}

.stage .brand__name {
  color: #e8eeeb;
}

.stage .brand__name span {
  color: #77857f;
}

.stage__body {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 30rem;
}

.stage__thesis {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.28;
}

.stage__thesis em {
  font-style: normal;
  color: #4cc194;
}

.stage__sub {
  color: #a8b5b0;
  font-size: var(--step-2);
  max-width: 28rem;
}

/* the lead card — the product's physical object, rendered as a real card */
.card-stack {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: 25rem;
}

.lead-card {
  background: #161e1b;
  border: 1px solid #26312d;
  border-radius: var(--radius);
  padding: 13px 15px;
  position: relative;
  overflow: hidden;
  animation: card-in 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

.lead-card:nth-child(2) {
  animation-delay: 0.09s;
}

.lead-card:nth-child(3) {
  animation-delay: 0.18s;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

.lead-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  width: 3px;
  height: 24px;
  border-radius: 0 3px 3px 0;
  background: var(--cold);
}

.lead-card--hot::before {
  background: #cf4437;
}

.lead-card--warm::before {
  background: #b08a30;
}

.lead-card__top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.lead-card__top b {
  font-size: var(--step-2);
  font-weight: 600;
  flex: 1;
}

.lead-card__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: var(--step-1);
  color: #77857f;
}

.pill {
  font-size: var(--step-0);
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  background: #1e2629;
  color: #8496a0;
  flex: none;
  letter-spacing: 0.02em;
}

.pill--hot {
  background: #331916;
  color: #cf4437;
}

.pill--warm {
  background: #2c2515;
  color: #b08a30;
}

.pill--ok {
  background: #123128;
  color: #4cc194;
}

.stage__foot {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: var(--step-1);
  color: #77857f;
}

.stage__foot svg {
  color: #2ba77c;
  flex: none;
}

/* ---------- form (right) ---------- */

.pane {
  display: flex;
  flex-direction: column;
  padding: 28px 24px 40px;
  overflow-y: auto;
}

.pane__top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: auto;
}

.pane__top .brand {
  display: none;
}

@media (max-width: 900px) {
  .pane__top .brand {
    display: flex;
  }
}

.theme-toggle {
  margin-left: auto;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
}

.theme-toggle:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.form-wrap {
  width: 100%;
  max-width: 25.5rem;
  margin: 40px auto;
}

.pane__foot {
  margin-top: auto;
  padding-top: 28px;
  display: flex;
  gap: 6px 18px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: var(--step-1);
  color: var(--ink-3);
}

.pane__foot a {
  color: inherit;
  text-decoration: none;
}

.pane__foot a:hover {
  color: var(--ink-2);
  text-decoration: underline;
}

/* ---------- view ---------- */

.view {
  display: none;
  flex-direction: column;
  gap: 22px;
}

.view.is-active {
  display: flex;
  animation: view-in 0.28s ease both;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.view__head h1 {
  font-size: var(--step-5);
  letter-spacing: -0.02em;
  margin-bottom: 7px;
}

.view__head p {
  color: var(--ink-2);
  font-size: var(--step-2);
}

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

.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 420px) {
  .form__row {
    grid-template-columns: 1fr;
  }
}

.switcher {
  font-size: var(--step-2);
  color: var(--ink-2);
  text-align: center;
}

.switcher a,
.link {
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
}

.switcher a:hover,
.link:hover {
  text-decoration: underline;
}

/* Segmented control: company sign-in vs. invite code */
.tabs {
  display: flex;
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}

.tabs button {
  flex: 1;
  border: 0;
  background: none;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: var(--step-1);
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.tabs button:hover {
  color: var(--ink);
}

.tabs button[aria-selected="true"] {
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* Invite code entry — monospace, letter-spaced, uppercased on the way in */
.input--code {
  font-family: var(--font-mono);
  font-size: var(--step-4);
  letter-spacing: 0.16em;
  text-align: center;
  text-transform: uppercase;
  padding: 13px;
}

.input--code::placeholder {
  letter-spacing: 0.16em;
}

/* Sent-state confirmation */
.sent {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.sent__icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
}

.sent__addr {
  font-family: var(--font-mono);
  font-size: var(--step-2);
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  word-break: break-all;
}

/* Demo-mode banner — visible whenever no backend is configured */
.demo-banner {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
  font-size: var(--step-1);
  font-weight: 600;
  color: var(--warm);
  background: var(--warm-soft);
  border: 1px solid color-mix(in srgb, var(--warm) 32%, transparent);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
}
