/* UI-1: the split sign-in page and the small Not found page (putusan ajudikasi 28 Nov 3.1, spec 04 B1.1 to B1.7).
   Loaded by these two pages only (partials/_sign.html), so the rest of the app is not touched by any rule here.
   Brand tokens of sinux.co.id: #3462A6, #284E86, #5AA2F5, #1C2E44; Poly + Poppins are the fonts already bundled by crm.css.
   Light and dark exist on these pages only (ubah 3): the variables live on `body:has(.sign)`, never on :root, and the
   app after sign-in stays light. Order: light, then the system dark when no choice was stored, then the stored choice
   (theme.js sets data-theme on <html> before the body is drawn). Background: CSS only, no image. */

body:has(.sign){
  --sg-page:#F5F7FB;
  --sg-hero:
    radial-gradient(55% 45% at 88% 92%, rgb(90 162 245 / .42) 0, rgb(90 162 245 / 0) 72%),
    radial-gradient(40% 35% at 8% 10%, rgb(90 162 245 / .22) 0, rgb(90 162 245 / 0) 70%),
    radial-gradient(circle at 104% 46%, rgb(255 255 255 / 0) 0 279px, rgb(255 255 255 / .13) 280px 281px, rgb(255 255 255 / 0) 282px),
    radial-gradient(circle at 104% 46%, rgb(255 255 255 / 0) 0 389px, rgb(255 255 255 / .09) 390px 391px, rgb(255 255 255 / 0) 392px),
    linear-gradient(150deg, #0B2C7A 0%, #1F4589 52%, #3462A6 100%);
  --sg-on-hero:#FFFFFF;
  --sg-on-hero-soft:#D7E9FF;
  --sg-glow:#5AA2F5;
  --sg-card:#FFFFFF;
  --sg-card-line:#DDE4EE;
  --sg-shadow:0 1px 2px rgb(16 32 64 / .06), 0 16px 40px -12px rgb(16 32 64 / .22);
  --sg-text:#1C2E44;
  --sg-soft:#566578;
  --sg-accent:#3462A6;
  --sg-accent-hover:#284E86;
  --sg-accent-wash:#EAF2FD;
  /* Google's own Light button: fill, stroke, text */
  --sg-g-bg:#FFFFFF;
  --sg-g-line:#747775;
  --sg-g-fg:#1F1F1F;
  --sg-g-hover:#F2F5FA;
  --sg-retry-bg:#FFF4D1; --sg-retry-fg:#6B4A00; --sg-retry-line:#E3C46E;
  --sg-admin-bg:#EAF2FD; --sg-admin-fg:#284E86; --sg-admin-line:#B5CFF1;
  --sg-account-bg:#FFF0EE; --sg-account-fg:#B02A2D; --sg-account-line:#F0B5AF;
  color-scheme:light;
  display:block;
  min-height:0;
  background:var(--sg-page);
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) body:has(.sign){
    --sg-page:#0B1424;
    --sg-hero:
      radial-gradient(55% 45% at 88% 92%, rgb(52 98 166 / .40) 0, rgb(52 98 166 / 0) 72%),
      radial-gradient(40% 35% at 8% 10%, rgb(90 162 245 / .12) 0, rgb(90 162 245 / 0) 70%),
      radial-gradient(circle at 104% 46%, rgb(255 255 255 / 0) 0 279px, rgb(255 255 255 / .09) 280px 281px, rgb(255 255 255 / 0) 282px),
      radial-gradient(circle at 104% 46%, rgb(255 255 255 / 0) 0 389px, rgb(255 255 255 / .06) 390px 391px, rgb(255 255 255 / 0) 392px),
      linear-gradient(150deg, #050C18 0%, #0B1F45 55%, #12305F 100%);
    --sg-on-hero:#FFFFFF; --sg-on-hero-soft:#C9DAF2; --sg-glow:#5AA2F5;
    --sg-card:#16243A; --sg-card-line:#2A3A54;
    --sg-shadow:0 1px 2px rgb(0 0 0 / .3), 0 16px 40px -12px rgb(0 0 0 / .6);
    --sg-text:#E6EDF7; --sg-soft:#A9B6C8;
    --sg-accent:#5AA2F5; --sg-accent-hover:#8BBEF8; --sg-accent-wash:#1D3150;
    /* Google's own Dark button */
    --sg-g-bg:#131314; --sg-g-line:#8E918F; --sg-g-fg:#E3E3E3; --sg-g-hover:#1F2023;
    --sg-retry-bg:#33290F; --sg-retry-fg:#F2C94C; --sg-retry-line:#6B5520;
    --sg-admin-bg:#14304F; --sg-admin-fg:#8BBEF8; --sg-admin-line:#2B5283;
    --sg-account-bg:#3A1A1E; --sg-account-fg:#FF9A90; --sg-account-line:#6E2E33;
    color-scheme:dark;
  }
}
:root[data-theme="dark"] body:has(.sign){
  --sg-page:#0B1424;
  --sg-hero:
    radial-gradient(55% 45% at 88% 92%, rgb(52 98 166 / .40) 0, rgb(52 98 166 / 0) 72%),
    radial-gradient(40% 35% at 8% 10%, rgb(90 162 245 / .12) 0, rgb(90 162 245 / 0) 70%),
    radial-gradient(circle at 104% 46%, rgb(255 255 255 / 0) 0 279px, rgb(255 255 255 / .09) 280px 281px, rgb(255 255 255 / 0) 282px),
    radial-gradient(circle at 104% 46%, rgb(255 255 255 / 0) 0 389px, rgb(255 255 255 / .06) 390px 391px, rgb(255 255 255 / 0) 392px),
    linear-gradient(150deg, #050C18 0%, #0B1F45 55%, #12305F 100%);
  --sg-on-hero:#FFFFFF; --sg-on-hero-soft:#C9DAF2; --sg-glow:#5AA2F5;
  --sg-card:#16243A; --sg-card-line:#2A3A54;
  --sg-shadow:0 1px 2px rgb(0 0 0 / .3), 0 16px 40px -12px rgb(0 0 0 / .6);
  --sg-text:#E6EDF7; --sg-soft:#A9B6C8;
  --sg-accent:#5AA2F5; --sg-accent-hover:#8BBEF8; --sg-accent-wash:#1D3150;
  --sg-g-bg:#131314; --sg-g-line:#8E918F; --sg-g-fg:#E3E3E3; --sg-g-hover:#1F2023;
  --sg-retry-bg:#33290F; --sg-retry-fg:#F2C94C; --sg-retry-line:#6B5520;
  --sg-admin-bg:#14304F; --sg-admin-fg:#8BBEF8; --sg-admin-line:#2B5283;
  --sg-account-bg:#3A1A1E; --sg-account-fg:#FF9A90; --sg-account-line:#6E2E33;
  color-scheme:dark;
}

/* ---- frame: one column below 960 px (Drive-demo shape), the card full width with a 16 px gutter below 640 px ---- */
.sign{
  position:relative;isolation:isolate;box-sizing:border-box;
  display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"brand theme" "card card";
  align-content:start;align-items:center;gap:var(--sp-6) var(--sp-4);
  /* Q-3: exactly one window high, so the page never scrolls; the STAGING strip takes its 36 px out of it (below) */
  min-height:100vh;min-height:100dvh;
  padding:var(--sp-4) var(--sp-4) var(--sp-8);
  background:var(--sg-hero);color:var(--sg-text);
}
body:has(.app-staging) .sign{min-height:calc(100vh - 36px);min-height:calc(100dvh - 36px)}
.sign:focus{outline:none}
.sign__panel{display:none}
.sign__brand{grid-area:brand;padding:0;color:var(--sg-on-hero)}
.sign__product{border-left-color:rgb(255 255 255 / .4)}
.sign__hero{grid-area:hero;display:none}

/* ---- the card ---- */
.sign__card{
  grid-area:card;justify-self:center;align-self:start;box-sizing:border-box;width:100%;max-width:440px;
  /* top-anchored to the window, never centred in the frame: the title stays where it is with or without the STAGING strip */
  margin-top:clamp(0px, 8vh - 24px, 72px);
  display:grid;gap:var(--sp-4);padding:var(--sp-8);
  background:var(--sg-card);color:var(--sg-text);
  border:1px solid var(--sg-card-line);border-radius:12px;box-shadow:var(--sg-shadow);
}
.sign__title{margin:0;color:var(--sg-text)}
.sign__title:focus-visible{outline:var(--focus-w) solid var(--sg-accent);outline-offset:var(--sp-1)}
.sign__lead{margin:0;color:var(--sg-text)}
.sign__actions{display:flex}
.sign__note{display:flex;align-items:flex-start;gap:var(--sp-2);margin:0;padding-top:var(--sp-4);border-top:1px solid var(--sg-card-line);
  font-size:var(--fs-14);line-height:var(--lh-14);color:var(--sg-soft)}
.sign__note .app-icon{flex:none;margin-top:2px;color:var(--sg-soft)}

/* the one action: Google's own button (fill, stroke, text, the G mark, the label "Sign in with Google") */
.sign__google{
  display:flex;align-items:center;justify-content:center;gap:var(--sp-3);box-sizing:border-box;width:100%;min-height:48px;
  padding:var(--sp-2) var(--sp-4);border:1px solid var(--sg-g-line);border-radius:var(--radius-pill);
  background:var(--sg-g-bg);color:var(--sg-g-fg);font:var(--fw-medium) var(--fs-16)/var(--lh-16) var(--font-ui);text-decoration:none;cursor:pointer;
}
.sign__google:hover{background:var(--sg-g-hover)}
.sign__g{flex:none;width:20px;height:20px}

/* the way back of a refusal and of Not found */
.sign .app-btn--secondary{min-height:44px;background:transparent;color:var(--sg-accent);border-color:var(--sg-accent)}
.sign .app-btn--secondary:hover{background:var(--sg-accent-wash);color:var(--sg-accent-hover);border-color:var(--sg-accent-hover)}

/* a refusal: its look follows its kind (try again, ask the admin, wrong account), the words stay those of vocabulary.py */
.sign__box{display:grid;grid-template-columns:var(--icon-m) minmax(0,1fr);gap:var(--sp-3);align-items:start;padding:var(--sp-4);
  border:1px solid var(--box-line);border-radius:8px;background:var(--box-bg)}
.sign__box .app-icon{color:var(--box-fg)}
.sign__boxtext{margin:0;color:var(--sg-text)}
.sign__box--retry{--box-bg:var(--sg-retry-bg);--box-fg:var(--sg-retry-fg);--box-line:var(--sg-retry-line)}
.sign__box--admin{--box-bg:var(--sg-admin-bg);--box-fg:var(--sg-admin-fg);--box-line:var(--sg-admin-line)}
.sign__box--account{--box-bg:var(--sg-account-bg);--box-fg:var(--sg-account-fg);--box-line:var(--sg-account-line)}

/* ---- the theme toggle: a labelled button whose pressed state says that dark is on ---- */
.sign__theme{
  --tg-fg:var(--sg-on-hero);--tg-bg:rgb(255 255 255 / .08);--tg-line:rgb(255 255 255 / .75);--tg-knob:#0B2C7A;--tg-focus:#FFFFFF;
  grid-area:theme;justify-self:end;display:inline-flex;align-items:center;gap:var(--sp-2);box-sizing:border-box;min-height:44px;
  padding:0 var(--sp-4) 0 var(--sp-3);border:1px solid var(--tg-line);border-radius:var(--radius-pill);
  background:var(--tg-bg);color:var(--tg-fg);font:var(--fw-medium) var(--fs-14)/var(--lh-14) var(--font-ui);cursor:pointer;
}
.sign__theme:focus-visible{outline:var(--focus-w) solid var(--tg-focus);outline-offset:2px}
.sign__switch{position:relative;flex:none;box-sizing:border-box;width:32px;height:18px;border:2px solid currentColor;border-radius:var(--radius-pill)}
.sign__switch::after{content:"";position:absolute;top:2px;left:2px;width:10px;height:10px;border-radius:50%;background:currentColor}
.sign__theme[aria-pressed="true"] .sign__switch{background:currentColor}
.sign__theme[aria-pressed="true"] .sign__switch::after{transform:translateX(14px);background:var(--tg-knob)}

/* focus on the gradient is white, on the card it is the accent */
.sign__card :focus-visible{outline:var(--focus-w) solid var(--sg-accent);outline-offset:2px}

@media (max-width: 639px){
  .sign{padding:var(--sp-4) var(--sp-4) var(--sp-6);gap:var(--sp-4)}
  .sign__card{padding:var(--sp-6) var(--sp-4);margin-top:var(--sp-2)}
  .sign .app-top__product{display:inline}
}

/* ---- split: the brand panel on the left, the card on the right, >= 960 px ---- */
@media (min-width: 960px){
  .sign{
    grid-template-columns:minmax(0,1.15fr) minmax(480px,1fr);grid-template-rows:auto auto 1fr;
    grid-template-areas:"brand theme" "hero card" ". .";
    gap:0;padding:0;background:var(--sg-page);
  }
  .sign__panel{display:block;grid-column:1;grid-row:1 / -1;align-self:stretch;z-index:-1;background:var(--sg-hero)}
  .sign__brand{padding:var(--sp-8) var(--sp-12) 0}
  .sign__hero{display:block;align-self:center;padding:0 var(--sp-12);color:var(--sg-on-hero)}
  .sign__name{margin:0;font-family:var(--font-display);font-weight:var(--fw-regular);font-size:clamp(44px, 4.4vw, 64px);line-height:1.08;letter-spacing:var(--tracking-display);color:var(--sg-on-hero)}
  .sign__name::after{content:"";display:block;width:56px;height:3px;margin-top:var(--sp-6);border-radius:2px;background:var(--sg-glow)}
  .sign__tagline{max-width:28ch;margin:var(--sp-6) 0 0;font-size:var(--fs-20);line-height:var(--lh-20);color:var(--sg-on-hero-soft)}
  .sign__theme{--tg-fg:var(--sg-text);--tg-bg:var(--sg-card);--tg-line:var(--sg-soft);--tg-knob:var(--sg-card);--tg-focus:var(--sg-accent);margin:var(--sp-6) var(--sp-8) 0}
  .sign__card{margin:clamp(32px, 15vh - 48px, 120px) var(--sp-8) 0;padding:40px}
}

/* motion: only when the system allows it, colours only, never longer than the existing --dur-base (UI-2 brings the rest) */
@media (prefers-reduced-motion: no-preference){
  .sign__google,.sign__theme,.sign .app-btn--secondary{transition:background-color var(--dur-fast) var(--ease-standard),border-color var(--dur-fast) var(--ease-standard),color var(--dur-fast) var(--ease-standard)}
  .sign__switch,.sign__switch::after{transition:transform var(--dur-moderate) cubic-bezier(.22,1,.36,1),background-color var(--dur-moderate) var(--ease-standard)}
}
