/* Q3-Intelligence showcase · sign-in page (Keycloak login theme "showcase"). Tokens and type from the site (src/css/site.css).
   Two layouts from one DOM:
   - wide landscape screens: the plant drawing fills the screen; the AI node sits on the page axis right under the title;
     the sign-in form rests in the drawing's empty lower-left corner;
   - phones and portrait tablets: title, the drawing cropped around the AI node and the fork, the form below. */
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(../fonts/montserrat-latin-var.woff2) format("woff2"); }

:root {
  --bg: #0d0d0f; --fg: #f5f7f7; --dim: #c6cfcf; --mute: #9aa5a5; --teal: #56b9ac; --teal2: #7fd3c8; --edge: #3a4247;
  --warn: #ffb27a; --ease: cubic-bezier(.45, 0, .2, 1);
  /* the AI node in the drawing (plant.webp, 1600 x 900): x 877, y 73 */
  --nx-f: .5481; --ny-f: .0811;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--fg);
  font-family: "Montserrat", Arial, sans-serif; font-size: 16px; line-height: 1.5; font-weight: 450;
  -webkit-font-smoothing: antialiased; }
h1, h2, p { margin: 0; }
a { color: var(--teal2); }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--teal2); outline-offset: 3px; border-radius: 2px; }

/* ------------------------------------------------------------ title */
.sc-head { text-align: center; position: relative; z-index: 2; }
.sc-title { font-weight: 700; letter-spacing: -.01em; line-height: 1.04; color: var(--fg); }
.sc-sub { color: var(--dim); font-weight: 500; text-wrap: balance; }

/* ------------------------------------------------------------ the drawing and the AGENTIC AI node (same look as the site) */
.sc-stage { overflow: hidden; pointer-events: none; }
.sc-art { position: absolute; aspect-ratio: 16 / 9; }
.sc-plant { width: 100%; height: 100%; }
.sc-node { position: absolute; left: calc(var(--nx-f) * 100%); top: calc(var(--ny-f) * 100%); width: 0; height: 0; }
.ai-halo { position: absolute; left: -34px; top: -34px; width: 68px; height: 68px; border-radius: 50%;
  background: radial-gradient(circle, rgba(127, 211, 200, .34), rgba(86, 185, 172, 0) 68%); opacity: .35;
  animation: breathe 5.5s var(--ease) infinite; }
@keyframes breathe { 0%, 100% { opacity: .2; transform: scale(.85); } 50% { opacity: .75; transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .ai-halo { animation: none; opacity: .4; } }
.ai-label { position: absolute; left: 18px; top: -11px; white-space: nowrap; padding: 5px 9px;
  background: rgba(13, 13, 15, .55); color: #c9f5ee;
  font: 750 12.5px/1 "Montserrat", sans-serif; letter-spacing: .2em; text-transform: uppercase; }

/* ------------------------------------------------------------ the panel: sign-in form and the other pages of the flow */
.sc-panel { position: relative; z-index: 2; width: 100%; max-width: 330px; }
.sc-panel-title { font: 700 12px/1.2 "Montserrat", sans-serif; letter-spacing: .2em; text-transform: uppercase; color: var(--teal);
  display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.sc-panel-title::before { content: ""; width: 28px; height: 2px; background: var(--teal); flex: none; }
.sc-signin .sc-panel-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }

.sc-group { margin: 0 0 20px; }
.sc-label { display: block; margin-bottom: 2px; font: 700 11px/1.4 "Montserrat", sans-serif; letter-spacing: .2em;
  text-transform: uppercase; color: var(--mute); transition: color .25s var(--ease); }
.sc-group:focus-within .sc-label { color: var(--teal2); }
.sc-input-group { position: relative; }
.sc-input { display: block; width: 100%; height: 44px; padding: 8px 0 7px; margin: 0; border: 0; border-radius: 0;
  border-bottom: 1px solid rgba(198, 207, 207, .30); background: transparent; color: var(--fg);
  font: 500 17px/1.3 "Montserrat", Arial, sans-serif; letter-spacing: .01em; caret-color: var(--teal2);
  box-shadow: 0 1px 0 0 transparent; transition: border-color .25s var(--ease), box-shadow .25s var(--ease); -webkit-appearance: none; appearance: none; }
.sc-input:hover { border-bottom-color: rgba(198, 207, 207, .5); }
.sc-input:focus { outline: none; border-bottom-color: var(--teal); box-shadow: 0 1px 0 0 var(--teal); }
.sc-input[aria-invalid="true"]:not(:focus) { border-bottom-color: rgba(255, 178, 122, .7); }
.sc-input-group .sc-input { padding-right: 42px; }
/* browser autofill keeps the dark field */
.sc-input:-webkit-autofill, .sc-input:-webkit-autofill:hover, .sc-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--fg); -webkit-box-shadow: 0 0 0 1000px #0f1113 inset; transition: background-color 9999s 0s; }

.sc-eye { position: absolute; right: -6px; top: 4px; width: 40px; height: 36px; border: 0; padding: 0; background: transparent;
  cursor: pointer; color: var(--mute); }
.sc-eye::before { content: ""; position: absolute; inset: 0; margin: auto; width: 20px; height: 20px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Cpath d='M2 12s3.6-6.5 10-6.5S22 12 22 12s-3.6 6.5-10 6.5S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Cpath d='M2 12s3.6-6.5 10-6.5S22 12 22 12s-3.6 6.5-10 6.5S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat; }
.sc-eye[aria-pressed="true"] { color: var(--teal2); }
.sc-eye[aria-pressed="true"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Cpath d='M2 12s3.6-6.5 10-6.5S22 12 22 12s-3.6 6.5-10 6.5S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M4 20L20 4'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Cpath d='M2 12s3.6-6.5 10-6.5S22 12 22 12s-3.6 6.5-10 6.5S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M4 20L20 4'/%3E%3C/svg%3E"); }
.sc-eye:hover { color: var(--fg); }

.sc-error, .sc-msg { margin: -6px 0 18px; padding-left: 12px; border-left: 2px solid var(--warn); color: var(--warn);
  font-size: 14px; line-height: 1.4; font-weight: 550; }
.sc-msg { margin: 0 0 20px; }
.sc-msg-info, .sc-msg-success { border-left-color: var(--teal); color: var(--dim); }
.sc-text, .instruction { color: var(--dim); font-size: 16px; margin: 0 0 22px; }
#kc-error-message p, #kc-info-message p { margin: 0 0 18px; }

.sc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px;
  border: 1px solid var(--edge); border-radius: 3px; background: rgba(13, 13, 15, .55); color: var(--fg); cursor: pointer;
  font: 650 15px/1 "Montserrat", sans-serif; letter-spacing: .03em; text-decoration: none;
  transition: background .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease); -webkit-appearance: none; appearance: none; }
.sc-btn-primary { background: var(--teal); border-color: var(--teal); color: #0b1514; }
.sc-btn-primary:hover { background: var(--teal2); border-color: var(--teal2); }
.sc-btn-block { display: flex; width: 100%; }
.sc-form .sc-btn { margin-top: 8px; }
.sc-btn.is-busy { opacity: .7; cursor: progress; }
input[type="submit"].sc-btn { width: 100%; }
#backToApplication, #kc-info-message a { display: inline-flex; align-items: center; min-height: 44px; color: var(--teal2);
  font-weight: 650; text-decoration: none; letter-spacing: .02em; }
#kc-info-message a:hover, #backToApplication:hover { color: var(--fg); }

/* ------------------------------------------------------------ footer: the issuer's mark, quiet */
.sc-foot { position: relative; z-index: 2; }
.sc-foot .logo-svg { height: 15px; width: auto; fill: var(--fg); opacity: .42; }

/* ============================================================ phones, portrait tablets, narrow windows: one column */
.sc-main { position: relative; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center;
  padding: max(26px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); }
.sc-title { font-size: clamp(34px, 9.4vw, 56px); }
.sc-sub { margin-top: 6px; font-size: clamp(15px, 4.1vw, 19px); line-height: 1.35; max-width: 20em; margin-left: auto; margin-right: auto; }
/* the drawing: 160 % of the screen width, window from x 400 to x 1400 of the drawing, from its top edge down */
.sc-stage { position: relative; flex: none; width: 100vw; margin: 12px calc(50% - 50vw) 0; --aw: 160vw;
  /* taller phones see more of the plant below the node; the node stays at the top */
  height: clamp(200px, calc(100vh - 500px), calc(var(--aw) * .5625 * 850 / 900));
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent), linear-gradient(to right, transparent, #000 9%, #000 91%, transparent);
  -webkit-mask-composite: source-in;
          mask-image: linear-gradient(to bottom, #000 72%, transparent), linear-gradient(to right, transparent, #000 9%, #000 91%, transparent);
          mask-composite: intersect; }
@supports (height: 100svh) { .sc-stage { height: clamp(200px, calc(100svh - 500px), calc(var(--aw) * .5625 * 850 / 900)); } }
.sc-art { width: var(--aw); left: calc(var(--aw) * -.25); top: 10px; }
.sc-panel { margin-top: 6px; }
.sc-foot { margin-top: auto; padding-top: 28px; }

@media (min-width: 600px) and (min-height: 521px) {   /* portrait tablets: the whole plant, the column centred */
  .sc-main { padding-top: 40px; padding-bottom: 84px; justify-content: center; }
  .sc-foot { position: absolute; left: 0; right: 0; bottom: max(30px, env(safe-area-inset-bottom)); display: flex; justify-content: center; padding: 0; }
  .sc-stage { --aw: 112vw; height: calc(var(--aw) * .5625 * 860 / 900); margin-top: 3vh; margin-bottom: 2vh; }
  .sc-art { left: calc(var(--aw) * -.072); top: 10px; }
  .sc-panel { max-width: 360px; }
}

/* ============================================================ wide landscape screens: the drawing fills the screen */
@media (min-width: 900px) and (min-aspect-ratio: 5 / 4) and (min-height: 521px) {
  .sc-main { display: block; min-height: 100vh; padding: 0; overflow: hidden; height: 100vh; --base: clamp(40px, 7.5vh, 88px); }
  /* node right under the title, on the page axis; drawing as large as the height allows */
  .sc-stage { position: fixed; inset: 0; width: auto; height: auto; margin: 0; -webkit-mask-image: none; mask-image: none;
    --ny: max(196px, 25vh); --aw: min(calc((100vh - var(--ny) - 10px) / .5169), 96vw); }
  .sc-art { width: var(--aw); left: calc(50vw - var(--aw) * var(--nx-f)); top: calc(var(--ny) - var(--aw) * .5625 * var(--ny-f)); }
  .sc-head { position: absolute; left: 0; right: 0; top: max(40px, 5.6vh); }
  .sc-title { font-size: clamp(40px, 3.9vw, 66px); }
  .sc-sub { margin-top: 10px; font-size: clamp(16px, 1.32vw, 22px); max-width: none; }
  /* the empty lower-left corner of the drawing */
  .sc-panel { position: absolute; left: clamp(40px, 5.4vw, 104px); bottom: var(--base); width: clamp(296px, 22vw, 340px); max-width: none;
    margin: 0; isolation: isolate; }
  /* soft shade under the form where a line of the drawing passes behind it (no box) */
  .sc-panel::before { content: ""; position: absolute; z-index: -1; inset: -56px -70px -40px -60px; pointer-events: none;
    background: radial-gradient(ellipse 58% 60% at 46% 52%, rgba(13, 13, 15, .82), rgba(13, 13, 15, 0) 100%); }
  .sc-foot { position: absolute; left: auto; right: clamp(40px, 5.4vw, 104px); bottom: var(--base); display: block; padding: 0; margin: 0; }
}

/* ============================================================ phones held sideways (short landscape): two columns */
@media (orientation: landscape) and (max-height: 520px) {
  .sc-main { display: grid; grid-template-columns: minmax(0, 1fr) min(300px, 40vw); grid-template-rows: auto 1fr auto;
    column-gap: 5vw; align-items: start; min-height: 100vh;
    padding: max(18px, env(safe-area-inset-top)) max(28px, env(safe-area-inset-right)) 14px max(28px, env(safe-area-inset-left)); }
  .sc-head { grid-column: 1; grid-row: 1; }
  .sc-title { font-size: clamp(28px, 5vw, 40px); }
  .sc-sub { font-size: 14px; max-width: none; margin-top: 4px; }
  .sc-stage { grid-column: 1; grid-row: 2 / 4; width: 100%; margin: 8px 0 0; height: calc(100vh - 120px);
    container-type: inline-size; }
  .sc-art { width: 112cqw; left: -6cqw; top: 6px; }
  .sc-panel { grid-column: 2; grid-row: 1 / 3; align-self: center; margin: 0; max-width: none; }
  .sc-foot { grid-column: 2; grid-row: 3; justify-self: center; padding: 6px 0 0; margin: 0; }
}
