/* Konsiar Connect sign-in page (owner: lead), 12 Nov 2026. Loaded after app.css on /login only (public/login/index.html).
   Sire: "the log in page is bland and plain. make it beautiful and decorate it with stuff to make it welcoming."
   Desktop (900px and up): a claret panel (the landing's "Atelier" plate: ivory text, brass hairlines) with a greeting from the
   visitor's clock and a sample chat that answers itself (public/assets/login-scene.js); the form on the right in an ivory mat
   with a brass hairline. Phones and tablets: a compact claret header above the form, no animation.
   The panel is claret in both themes; the form side follows app.css tokens. Motion: transform and opacity only.
   Contrast (WCAG, measured 12 Nov): see the pairs listed beside each colour below; all text 4.5:1 or more. */

/* ---------- tokens ---------- */
:root {
  /* panel, both themes */
  --sc-claret: #2A080D;
  --sc-card: #34111A;                       /* chat card on the panel */
  --sc-ivory: #F3ECE1;                      /* 15.7:1 on claret, 14.4:1 on card */
  --sc-stone: #CFC4B4;                      /* 10.7:1 on claret, 9.8:1 on card */
  --sc-brass: #C9A96E;                      /* 8.2:1 on claret, 7.6:1 on card */
  --sc-grey: #B8A99B;                       /* 8.1:1 on claret, 7.4:1 on card */
  --sc-line: rgba(201, 169, 110, .24);      /* brass hairlines (decorative) */
  --sc-line-2: rgba(201, 169, 110, .46);    /* the automatic reply's edge and the fact slots */
  --sc-frame: rgba(201, 169, 110, .16);
  --sc-well: rgba(243, 236, 225, .08);      /* customer bubble: ivory 11.8:1 */
  --sc-avatar: rgba(243, 236, 225, .10);    /* avatar: pink initials 6.7:1 */
  --sc-pink: #FF9CBF;
  --sc-slot: rgba(201, 169, 110, .16);      /* empty fact slot: ivory value 10.8:1 */
  --sc-warn: #F2A65F;                       /* Needs you: 6.5:1 on its row */
  --sc-needs: rgba(242, 166, 95, .13);
  --sc-ok: #3DDC84;
  --sc-chip-line: rgba(243, 236, 225, .26);
  --sc-out: cubic-bezier(.23, 1, .32, 1);
  --sc-soft: cubic-bezier(.215, .61, .355, 1);
  --sc-dots: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22'%3E%3Ccircle cx='1' cy='1' r='1' fill='%23C9A96E' fill-opacity='.22'/%3E%3C/svg%3E");
}
/* form side: dark by default (same order as app.css) */
:root, :root[data-theme="dark"] {
  --auth-mat: #1B1416; --auth-brass-line: rgba(201, 169, 110, .28); --auth-brass: #C9A96E; --auth-card-line: #332A2D;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --auth-mat: #F4EFE7; --auth-brass-line: rgba(168, 135, 90, .38); --auth-brass: #A8875A; --auth-card-line: #E7E4DF;
  }
}
:root[data-theme="light"] {
  --auth-mat: #F4EFE7; --auth-brass-line: rgba(168, 135, 90, .38); --auth-brass: #A8875A; --auth-card-line: #E7E4DF;
}

/* ---------- page: phones and tablets first ---------- */
.auth.auth-scene { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; min-height: 100dvh; background: var(--bg); }

/* the claret header (phones) / panel (desktop) */
.scene { position: relative; isolation: isolate; display: grid; gap: 16px; min-width: 0;
  margin: max(8px, env(safe-area-inset-top)) 8px 0; padding: 18px 20px 22px; border-radius: 20px;
  background: var(--sc-claret); color: var(--sc-ivory); overflow: hidden; }
.scene::before { content: ""; position: absolute; z-index: -1; inset: 8px; border-radius: 13px; border: 1px solid var(--sc-frame);
  background-image: var(--sc-dots); background-position: 10px 10px; pointer-events: none; }
.scene p { margin: 0; }
.scene-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 20px; }
.scene-mark { font-size: 14px; line-height: 1; color: var(--sc-ivory); white-space: nowrap; }
.scene-date { font: 500 10.5px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--sc-stone);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.scene-hello { display: grid; gap: 6px; }
.scene-greet { font-family: var(--font); font-weight: 500; font-size: 28px; line-height: 1.1; letter-spacing: -.028em; color: var(--sc-ivory); }
.scene-greet::after { content: "."; color: var(--sc-brass); }
.scene-lede { font-size: 14px; line-height: 1.5; color: var(--sc-stone); max-width: 30rem; text-wrap: balance; }
.scene-card, .scene-foot { display: none; }
@media (min-width: 600px) and (max-width: 899px) { .scene { justify-self: center; width: min(calc(100% - 16px), 464px); margin-inline: 0; } }
/* 1 Dec 2026: the wordmark is "Konsiar Connect", so phones show the weekday only and the narrowest drop the date. */
@media (max-width: 479px) { .scene-date .rest { display: none; } }
@media (max-width: 359px) { .scene-date { display: none; } }
/* the greeting and date come from the visitor's clock (login-scene.js); they appear when set, never as a swap.
   If the script never runs, the neutral "Welcome." shows after a moment. */
.scene-greet:not(.is-set), .scene-date:not(.is-set) { opacity: 0; animation: sc-show .4s .9s forwards; }
.scene-greet.is-set, .scene-date.is-set { opacity: 1; transition: opacity .5s var(--sc-out); }
@keyframes sc-show { to { opacity: 1; } }

/* the form in an ivory mat with a brass hairline (the landing's inbox frame) */
.auth-scene .form-col { display: grid; place-items: start center; padding: 20px 16px max(40px, env(safe-area-inset-bottom)); }
.auth-scene .mat { width: min(100%, 448px); min-width: 0; padding: 7px; border-radius: 24px; background: var(--auth-mat);
  border: 1px solid var(--auth-brass-line); }
.auth.auth-scene #view.card { width: 100%; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; display: block; }
.auth.auth-scene #view > form, .auth.auth-scene #view > .card { width: 100%; display: grid; gap: 18px; padding: 28px 22px 22px;
  border-radius: 17px; background: var(--bg-raised); border: 1px solid var(--auth-card-line); box-shadow: none; min-width: 0; }
.auth-scene #view .brand { display: none; }   /* the wordmark sits in the claret panel or header */
.auth-scene #view h1 { font-size: 26px; line-height: 1.15; letter-spacing: -.022em; }
.auth-scene #view h1::before { content: ""; display: block; width: 28px; height: 1px; margin-bottom: 16px; background: var(--auth-brass); }
.auth-scene #view h1 + .lede { margin-top: 8px; }
.auth-scene #view > .card > h1 + .lede { margin-top: -8px; }   /* done views: title and text are grid items */
.auth-scene #view .lede { font-size: 14px; line-height: 1.5; }
.auth-scene #view .field { gap: 7px; }
.auth-scene #view .input { min-height: 44px; padding: 10px 14px; font-size: 15px; }
.auth-scene #view .reveal-wrap .input { padding-right: 76px; }
.auth-scene #view .btn.primary { min-height: 46px; font-size: 15px; }
.auth-scene #view .btn.social { min-height: 44px; }
.auth-scene #view > form > div:last-child:has(> .theme-toggle) { display: grid; gap: 6px; margin-top: 2px; padding-top: 16px;
  border-top: 1px solid var(--border); }
.auth-scene #view .faint { font-size: 12.5px; line-height: 1.7; }
.auth-scene #view .theme-toggle { justify-self: start; margin-left: -12px; }

/* ---------- desktop: the panel beside the form ---------- */
@media (min-width: 900px) {
  .auth.auth-scene { grid-template-columns: clamp(440px, 51vw, 820px) minmax(0, 1fr); align-content: stretch; }
  .scene { display: flex; flex-direction: column; gap: 32px; margin: 12px 0 12px 12px; min-height: calc(100dvh - 24px);
    padding: clamp(36px, 3.4vw, 52px) clamp(36px, 3.8vw, 60px); border-radius: 26px; }
  .scene::before { inset: 12px; border-radius: 15px; background-position: 14px 14px; }
  .scene-mark { font-size: 15px; }
  .scene-hello { gap: 14px; margin-top: auto; }
  .scene-greet { font-weight: 450; font-size: clamp(42px, 3.9vw, 58px); line-height: 1.02; letter-spacing: -.038em; }
  .scene-lede { font-size: 16px; line-height: 1.55; max-width: 27rem; }
  /* the card sits on the right edge (the date's edge) while the words keep the left one */
  .scene-card { display: block; align-self: flex-end; width: min(100%, 490px); margin: 0 0 auto; }
  .scene-foot { display: grid; gap: 10px; padding-top: 18px; border-top: 1px solid var(--sc-line); }

  .auth-scene .form-col { place-items: center; padding: 48px clamp(24px, 4vw, 64px); }
  .auth-scene .mat { width: min(100%, 456px); padding: 10px; border-radius: 28px; }
  .auth.auth-scene #view > form, .auth.auth-scene #view > .card { gap: 20px; padding: 42px 38px 32px; border-radius: 19px; }
  .auth-scene #view h1 { font-size: 28px; }
}

/* ---------- channel status (desktop panel) ---------- */
.scene-status { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 13.5px; line-height: 1.45;
  color: var(--sc-stone); }
.scene-status li { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; }
.scene-status li::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--sc-stone); }
.scene-status .st-ok::before { background: var(--sc-ok); border-color: var(--sc-ok); }
.scene-status .st-wait::before { background: var(--sc-brass); border-color: var(--sc-brass); }
.scene-status b { font-weight: 600; color: var(--sc-ivory); }
.scene-note { font-size: 12px; line-height: 1.5; color: var(--sc-grey); }

/* ---------- the sample chat (desktop panel) ---------- */
.scene-card { padding: 18px 20px 20px; border-radius: 18px; background: var(--sc-card); border: 1px solid var(--sc-line); }
.sc-head { display: flex; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--sc-line); }
.sc-avatar { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--sc-avatar);
  color: var(--sc-pink); font-size: 11px; font-weight: 600; letter-spacing: .02em; }
.sc-who { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; }
.sc-who b { font-weight: 600; color: var(--sc-ivory); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-chip { flex: none; padding: 0 8px; border: 1px solid var(--sc-chip-line); border-radius: 999px; font-size: 11px; line-height: 18px;
  color: var(--sc-stone); }
.sc-tag { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; font: 500 10.5px/1 var(--mono); letter-spacing: .14em;
  text-transform: uppercase; color: var(--sc-grey); white-space: nowrap; }
.sc-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--sc-brass); }
.sc-thread { list-style: none; margin: 0; padding: 16px 0 0; display: grid; gap: 12px; }
.sc-thread > li { min-width: 0; }
.sc-msg { display: grid; gap: 4px; max-width: 88%; }
.sc-msg p { padding: 9px 13px; border-radius: 12px; font-size: 14px; line-height: 1.45; color: var(--sc-ivory); text-wrap: pretty; }
.sc-msg.them { justify-self: start; }
.sc-msg.them p { background: var(--sc-well); border-bottom-left-radius: 4px; }
.sc-msg.auto, .sc-msg.sys { justify-self: end; position: relative; }
.sc-msg.auto p, .sc-msg.sys p { box-shadow: inset 0 0 0 1px var(--sc-line-2); border-bottom-right-radius: 4px; }
.sc-meta { font-size: 11.5px; line-height: 1.3; color: var(--sc-stone); }
.sc-msg.auto .sc-meta, .sc-msg.sys .sc-meta { justify-self: end; text-align: right; }
.sc-meta b { font-weight: 600; color: var(--sc-brass); }
.sc-needs { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: var(--sc-needs);
  font-size: 13.5px; line-height: 1.35; color: var(--sc-ivory); }
.sc-needs .icon { width: 17px; height: 17px; flex: none; color: var(--sc-warn); }
.sc-needs b { font-weight: 600; color: var(--sc-warn); margin-right: 8px; }
/* a fact: the slot the AI leaves (brass box) and the value software drops into it (brass underline) */
.fact { position: relative; display: inline-block; font-weight: 600; white-space: nowrap; }
.fact::before { content: ""; position: absolute; inset: -1px -4px; border-radius: 4px; background: var(--sc-slot);
  box-shadow: inset 0 0 0 1px var(--sc-line-2); opacity: 0; }
.fact::after, .src::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1.5px; background: var(--sc-brass);
  transform-origin: left center; }
.fact .v { position: relative; display: inline-block; }
.src { position: relative; display: inline-block; }
.sc-dots { display: none; }

/* the sequence: only once login-scene.js arms the card (motion allowed, panel on screen). Every row keeps its place from
   the start, so the card never changes height. */
.scene-card.armed .sc-thread > li { opacity: 0; transform: translateY(8px);
  transition: opacity .5s var(--sc-out), transform .7s var(--sc-out); }
.scene-card.armed .sc-thread > li.on, .scene-card.armed .sc-thread > li.typing { opacity: 1; transform: none; }
.scene-card.armed .sc-msg.auto > p, .scene-card.armed .sc-msg.auto > .sc-meta { transition: opacity .45s var(--sc-out); }
.scene-card.armed .sc-msg.auto.typing > p, .scene-card.armed .sc-msg.auto.typing > .sc-meta { opacity: 0; }
.scene-card.armed .sc-dots { display: flex; gap: 4px; position: absolute; top: 0; right: 0; padding: 13px 14px; border-radius: 12px;
  border-bottom-right-radius: 4px; background: var(--sc-card); box-shadow: inset 0 0 0 1px var(--sc-line-2); opacity: 0;
  transition: opacity .3s var(--sc-soft); pointer-events: none; }
.scene-card.armed .typing .sc-dots { opacity: 1; }
.sc-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--sc-stone); opacity: .3; }
.scene-card.armed .typing .sc-dots i { animation: sc-blink 1.2s infinite both; }
.scene-card.armed .typing .sc-dots i:nth-child(2) { animation-delay: .15s; }
.scene-card.armed .typing .sc-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes sc-blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
/* facts drop into their slots one by one; the slot clears and a brass underline draws under the value */
.scene-card.armed .fact .v { opacity: 0; transform: translateY(-.6em); transition: opacity .35s var(--sc-out), transform .55s var(--sc-out); }
.scene-card.armed .fact::before { opacity: 1; transition: opacity .6s var(--sc-soft) .3s; }
.scene-card.armed .fact::after, .scene-card.armed .src::after { transform: scaleX(0); transition: transform .6s var(--sc-out) .15s; }
.scene-card.armed .fact.lit .v { opacity: 1; transform: none; }
.scene-card.armed .fact.lit::before { opacity: 0; }
.scene-card.armed .fact.lit::after, .scene-card.armed.facts-on .src::after { transform: none; }
/* end of a round: the thread lifts away, then the next round starts from an empty card */
.sc-thread { transition: opacity .6s var(--sc-soft), transform .6s var(--sc-soft); }
.scene-card.fading .sc-thread { opacity: 0; transform: translateY(-6px); }
.scene-card.instant, .scene-card.instant *, .scene-card.instant *::before, .scene-card.instant *::after { transition: none !important; }
/* before the script arms the card the thread waits unseen (so it does not flash full, then empty); if the script never
   runs, the finished thread appears after a moment */
@media (min-width: 900px) and (prefers-reduced-motion: no-preference) {
  .scene-card:not(.armed):not(.done) .sc-thread { opacity: 0; animation: sc-show .6s 2.5s forwards; }
}
@media (prefers-reduced-motion: reduce) {
  .scene-card .sc-dots { display: none !important; }
}

/* short laptop screens: everything still fits without scrolling */
@media (min-width: 900px) and (max-height: 880px) {
  .scene { gap: 22px; padding-block: 30px; }
  .scene-hello { gap: 10px; }
  .scene-greet { font-size: clamp(38px, 3.4vw, 48px); }
  .scene-lede { font-size: 15px; }
  .scene-card { padding: 14px 16px 16px; }
  .sc-thread { gap: 9px; padding-top: 12px; }
  .sc-msg p { padding: 7px 12px; font-size: 13.5px; }
  .sc-head { padding-bottom: 11px; }
  .scene-note { display: none; }
  .scene-status { font-size: 13px; gap: 6px 18px; }
}
@media (min-width: 900px) and (max-height: 780px) {
  .sc-msg.them .sc-meta { display: none; }
}
@media (min-width: 900px) and (max-height: 700px) {
  .scene-lede { display: none; }
}
