/* Pagine di accesso: stessi token del CRM (resources/prototipo, docs/kit/design/tokens.css), pannello del marchio
   e scheda di accesso (ADV-TEC-UXI-007 §3, §7). Nessuna risorsa esterna: font e logo sono serviti da public/. */
:root{
  --frame:#BBD7D0; --bg:#F2F6F5; --surface:#FAFAFA; --surface-2:#E8F0EE; --hover:#E2ECE9;
  --line:#D3E1DD; --line-2:#BACFC9;
  --ink:#1E2A2E; --ink-2:#46575B; --ink-3:#5A6B6F;
  --brand:#E73D5F; --accent:#D42F52; --accent-hover:#C8294B; --accent-ink:#B8274A; --on-accent:#FFFFFF;
  --tint:#DDEBE7; --tint-ink:#2F5F57;
  --warn:#855600; --warn-soft:#F8EED6; --crit:#A8201A; --crit-soft:#F8E3E0;
  --focus:#1E2A2E;
  --shadow:0 1px 2px rgba(30,42,46,.06),0 12px 32px -8px rgba(30,42,46,.18);
  /* Pulsante Microsoft: colori neutri delle linee guida «Sign in with Microsoft», tema chiaro. */
  --ms-bg:#FFFFFF; --ms-ink:#5E5E5E; --ms-line:#8C8C8C; --ms-hover:#F3F3F3;
  /* Pannello del marchio: scuro in entrambi i temi, il logo nasce per un fondo scuro o chiaro. */
  --panel:#1E2A2E; --panel-2:#24393A; --panel-ink:#F2F6F5; --panel-ink-2:#C2D1CD; --panel-line:rgba(187,215,208,.16);
  --f:'Geist','Segoe UI',system-ui,-apple-system,Roboto,sans-serif;
  --r:8px; --r-lg:12px;
}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){
  --frame:#2F4043; --bg:#354749; --surface:#3B4F52; --surface-2:#415659; --hover:#475E61;
  --line:#4C6366; --line-2:#5A7477;
  --ink:#F2F6F5; --ink-2:#D2DEDB; --ink-3:#C2D1CD;
  --accent-ink:#FFB0C0;
  --tint:#4A6865; --tint-ink:#E3EFEC;
  --warn:#F5CF7E; --warn-soft:#554A30; --crit:#FFB4AB; --crit-soft:#5D413E;
  --focus:#F2F6F5;
  --shadow:0 1px 2px rgba(0,0,0,.14),0 14px 36px -10px rgba(0,0,0,.28);
  --ms-bg:#2F2F2F; --ms-ink:#FFFFFF; --ms-line:#8C8C8C; --ms-hover:#3A3A3A;
  --panel:#1A2427; --panel-2:#22302F;
  color-scheme:dark;
}}
:root[data-theme="dark"]{
  --frame:#2F4043; --bg:#354749; --surface:#3B4F52; --surface-2:#415659; --hover:#475E61;
  --line:#4C6366; --line-2:#5A7477;
  --ink:#F2F6F5; --ink-2:#D2DEDB; --ink-3:#C2D1CD;
  --accent-ink:#FFB0C0;
  --tint:#4A6865; --tint-ink:#E3EFEC;
  --warn:#F5CF7E; --warn-soft:#554A30; --crit:#FFB4AB; --crit-soft:#5D413E;
  --focus:#F2F6F5;
  --shadow:0 1px 2px rgba(0,0,0,.14),0 14px 36px -10px rgba(0,0,0,.28);
  --ms-bg:#2F2F2F; --ms-ink:#FFFFFF; --ms-line:#8C8C8C; --ms-hover:#3A3A3A;
  --panel:#1A2427; --panel-2:#22302F;
  color-scheme:dark;
}

*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;min-height:100vh;min-height:100dvh;background:var(--bg);color:var(--ink);font-family:var(--f);font-size:15px;line-height:1.55;-webkit-font-smoothing:antialiased;font-feature-settings:"ss01","cv11";overflow-wrap:anywhere}
h1,p{margin:0}

/* ---------- Struttura: pannello del marchio a sinistra, accesso a destra; impilati sotto 900px ---------- */
.auth{min-height:100vh;min-height:100dvh;display:grid;grid-template-columns:minmax(360px,5fr) 7fr}

.auth-brand{position:relative;isolation:isolate;overflow:hidden;display:flex;flex-direction:column;gap:40px;padding:48px clamp(32px,5vw,72px);color:var(--panel-ink);
  background:
    radial-gradient(120% 70% at 0% 100%,rgba(47,95,87,.55),transparent 60%),
    radial-gradient(90% 60% at 100% 0%,rgba(231,61,95,.10),transparent 55%),
    linear-gradient(160deg,var(--panel-2),var(--panel) 60%)}
/* La barra obliqua della «A» del logo, ripresa in grande e quasi trasparente, con una trama di linee parallele. */
.auth-brand::before{content:"";position:absolute;z-index:-1;inset:-20% -10%;pointer-events:none;
  background:repeating-linear-gradient(118deg,transparent 0 22px,var(--panel-line) 22px 23px);
  -webkit-mask-image:linear-gradient(200deg,#000,transparent 55%);mask-image:linear-gradient(200deg,#000,transparent 55%);opacity:.55}
.auth-brand::after{content:"";position:absolute;z-index:-1;right:12%;bottom:-10%;width:64px;height:78%;pointer-events:none;
  background:linear-gradient(180deg,rgba(231,61,95,0) 10%,rgba(231,61,95,.2));transform:skewX(-22deg);border-radius:6px}

.auth-logo{display:block;width:184px;height:auto}
.auth-brand-body{margin-top:auto;margin-bottom:auto;display:flex;flex-direction:column;gap:14px;max-width:420px}
.auth-product{font-size:clamp(56px,6vw,84px);line-height:.95;font-weight:700;letter-spacing:-.04em;color:var(--panel-ink)}
.auth-product::after{content:"";display:block;width:56px;height:4px;margin-top:22px;border-radius:2px;background:var(--brand)}
.auth-claim{font-size:18px;line-height:1.5;color:var(--panel-ink-2);text-wrap:balance}
.auth-brand-foot{font-size:13px;color:var(--panel-ink-2);letter-spacing:.01em}

.auth-main{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:28px;padding:48px 24px 32px;min-width:0}

/* ---------- Scheda di accesso ---------- */
.auth-card{width:100%;max-width:448px;background:var(--surface);border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow);padding:36px 36px 30px;display:flex;flex-direction:column;gap:20px;animation:auth-in .35s ease-out both}
@keyframes auth-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.auth-head{display:flex;flex-direction:column;gap:8px}
.auth-eyebrow{font-size:12.5px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--tint-ink)}
.auth-card h1{font-size:26px;line-height:1.2;font-weight:650;letter-spacing:-.02em;text-wrap:balance}
.auth-lead{color:var(--ink-2);font-size:15px;text-wrap:pretty}

/* Pulsante «Sign in with Microsoft»: fondo neutro, logo a quattro quadrati 21px, testo semibold, bordo sottile. */
.ms-btn{display:flex;align-items:center;justify-content:center;gap:12px;min-height:48px;padding:10px 16px;border-radius:4px;background:var(--ms-bg);border:1px solid var(--ms-line);color:var(--ms-ink);font-family:'Segoe UI',var(--f);font-weight:600;font-size:15px;line-height:1.3;text-decoration:none;text-align:center;transition:background-color .12s,border-color .12s}
.ms-btn:hover{background:var(--ms-hover)}
.ms-btn:active{border-color:var(--ink-3)}
.ms-logo{flex:none;width:21px;height:21px}
.ms-btn span{min-width:0;text-align:left}

.auth-note{display:flex;gap:10px;align-items:flex-start;font-size:13.5px;color:var(--ink-2);padding-top:18px;border-top:1px solid var(--line)}
.auth-note.is-plain{padding-top:0;border-top:0}
.auth-note svg,.auth-alert svg{flex:none;width:18px;height:18px;margin-top:2px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.auth-note svg{color:var(--tint-ink)}

/* Esiti: icona e titolo oltre al colore (WCAG 1.4.1). */
.auth-alert{display:flex;gap:12px;align-items:flex-start;padding:12px 14px;border-radius:var(--r);background:var(--crit-soft);color:var(--ink);border:1px solid color-mix(in srgb,var(--crit) 35%,transparent);border-left:4px solid var(--crit);font-size:14px}
.auth-alert > div{display:flex;flex-direction:column;gap:2px;min-width:0}
.auth-alert-title{font-weight:600}
.auth-alert svg{color:var(--crit)}
.auth-alert strong{font-weight:600}
.auth-alert.is-info{background:var(--tint);border-color:var(--line-2);border-left-color:var(--tint-ink)}
.auth-alert.is-info svg{color:var(--tint-ink)}

.auth-foot{max-width:448px;display:flex;flex-direction:column;gap:2px;text-align:center;font-size:13px;color:var(--ink-2);text-wrap:balance}
.auth-legal{margin-top:8px;color:var(--ink-3)}

a:focus-visible,button:focus-visible{outline:2px solid var(--focus);outline-offset:3px}
.ms-btn:focus-visible{outline:2px solid var(--focus);outline-offset:3px;box-shadow:0 0 0 1px var(--surface)}

/* ---------- Accesso di sviluppo: deve sembrare uno strumento, non la pagina di produzione (ADV-TEC-UXI-007 §8) ---------- */
.dev-band{position:sticky;top:0;z-index:2;padding:8px 16px;text-align:center;font-size:13px;font-weight:600;color:#3D2A00;background:repeating-linear-gradient(-45deg,#F5CF7E 0 14px,#EFC264 14px 28px);border-bottom:1px solid #C99A2E}
.dev-badge{display:inline-flex;align-items:center;gap:6px;padding:3px 9px;border-radius:999px;background:var(--warn-soft);color:var(--warn);border:1px solid color-mix(in srgb,var(--warn) 40%,transparent);letter-spacing:.04em}
.dev-badge::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor}
.is-dev .auth-main{justify-content:flex-start}
.is-dev .auth-card{max-width:520px}
.dev-users{display:flex;flex-direction:column;gap:8px}
.dev-users-label{font-size:13px;font-weight:600;color:var(--ink-2)}
.dev-users button{display:flex;align-items:center;gap:12px;width:100%;min-height:52px;padding:8px 12px;text-align:left;font:inherit;font-size:15px;color:var(--ink);background:var(--surface);border:1px solid var(--line-2);border-radius:var(--r);cursor:pointer;transition:background-color .12s,border-color .12s}
.dev-users button:hover{background:var(--hover);border-color:var(--ink-3)}
.dev-avatar{flex:none;width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:var(--tint);color:var(--tint-ink);font-weight:650;font-size:14px}
.dev-name{flex:1;min-width:0;font-weight:550;overflow-wrap:anywhere}
.dev-role{flex:none;font-size:12.5px;color:var(--ink-2);background:var(--surface-2);border:1px solid var(--line);border-radius:999px;padding:2px 9px}
.dev-tag{flex:none;font-size:12.5px;color:var(--warn);background:var(--warn-soft);border-radius:999px;padding:2px 9px}

/* ---------- Schermi stretti: il marchio diventa una fascia compatta sopra la scheda ---------- */
@media (max-width:900px){
  .auth{grid-template-columns:1fr;grid-template-rows:auto 1fr}
  .auth-brand{gap:14px;padding:22px 20px 24px}
  .auth-brand::after{width:28px;height:140%;right:14%;bottom:-20%}
  .auth-logo{width:132px}
  .auth-brand-body{margin:0;gap:6px;max-width:none}
  .auth-product{font-size:30px;letter-spacing:-.03em}
  .auth-product::after{display:none}
  .auth-claim{font-size:14.5px}
  .auth-brand-foot{display:none}
  .auth-main{justify-content:flex-start;padding:24px 16px 28px;gap:22px}
}
@media (max-width:480px){
  .auth-card{padding:24px 20px 22px;border-radius:14px;gap:18px}
  .auth-card h1{font-size:22px}
  .ms-btn{font-size:14.5px;padding:10px 12px}
}
@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation:none!important;transition:none!important}}
@media (forced-colors: active){.ms-btn,.auth-card,.auth-alert{border:1px solid CanvasText}}
