/* Access pages: login, recovery, password change and the administration of
   accounts. base.css brings the tokens and the top bar, the same ones the
   dashboard uses; this sheet is the card in the middle of the page and the
   administration tables. Everything is scoped to .auth-main so no rule here
   reaches the bar. */
[hidden]{display:none!important}
.auth-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.auth-icon{flex:none;width:1.25rem;height:1.25rem;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
.auth-mark{stroke:none}
/* Centred on the window, not on what a scrollbar leaves of it: a notice can
   make the page taller than the screen, and the card must not step aside the
   moment the scrollbar comes in. */
.auth-main{width:min(100% - 2*var(--space-4),27.5rem);margin:clamp(var(--space-8),9vh,6rem) auto var(--space-10);margin-left:max(var(--space-4),50vw - 13.75rem)}
.auth-main a{color:var(--blue);font-weight:600}
.auth-main a:hover{color:#00589e}
.auth-main button,.auth-main a,.auth-main input{touch-action:manipulation}
.auth-main :focus-visible{outline:3px solid var(--header-focus);outline-offset:2px}

/* The card, with the TRACTIAN logo above the title as in the other apps. */
.auth-card{padding:var(--space-10) var(--space-8) var(--space-8);border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);box-shadow:var(--shadow)}
.auth-logo{display:block;width:11.25rem;max-width:70%;aspect-ratio:15/2;margin:0 auto var(--space-6);background:var(--ink);-webkit-mask:url(logo-tractian-wide.svg) center/contain no-repeat;mask:url(logo-tractian-wide.svg) center/contain no-repeat}
.auth-panel{text-align:center}
.auth-panel h1{margin:0;font-size:var(--text-2xl);font-weight:700;line-height:var(--leading-tight);letter-spacing:-.02em;text-wrap:balance}
.auth-panel p{margin:var(--space-2) 0 0;color:var(--muted);font-size:var(--text-sm);line-height:var(--leading-normal);text-wrap:pretty}
.auth-panel .muted{color:var(--muted);overflow-wrap:anywhere}

/* What the card answers, inside it and above the form, where the eyes already
   are. The colour and the bar on the left say how serious it is, the icon says
   it again for whoever does not tell the colours apart, and the words say what
   to do. It used to be one small line under the card. */
.auth-alerts{text-align:left}
.auth-alert{display:flex;align-items:flex-start;gap:var(--space-3);margin-top:var(--space-5);padding:var(--space-3) var(--space-4);border:1px solid;border-left-width:4px;border-radius:var(--radius-xs);font-size:var(--text-sm);line-height:var(--leading-normal);overflow-wrap:anywhere;animation:auth-alert-in .2s ease-out}
.auth-alert .auth-icon{margin-top:.0625rem}
.auth-alert-body{display:grid;gap:.125rem;min-width:0}
.auth-alert-body span{color:var(--ink)}
.auth-alert.error{border-color:#e6bdb6;border-left-color:var(--danger);background:#fdf1ef;color:var(--danger)}
.auth-alert.warning{border-color:#ecd2a8;border-left-color:#955315;background:#fff1df;color:#955315}
.auth-alert.success{border-color:#b5dcd2;border-left-color:var(--teal);background:#e3f3ef;color:#12625c}
.auth-alert.info{border-color:#b6cfe2;border-left-color:var(--blue);background:var(--blue-soft);color:#00589e}
@keyframes auth-alert-in{from{opacity:0;transform:translateY(-.25rem)}}
.auth-loading{display:flex;align-items:center;justify-content:center;gap:var(--space-3);min-height:var(--control-h);color:var(--muted);font-size:var(--text-sm)}
.auth-loading::before{content:"";flex:none;width:1rem;height:1rem;border:2px solid #c5d3df;border-top-color:var(--blue);border-radius:50%;animation:auth-spin .7s linear infinite}
@keyframes auth-spin{to{transform:rotate(360deg)}}

/* Forms: a quiet label over a field as tall as the dashboard's controls. */
.auth-form{display:grid;gap:var(--space-4);margin-top:var(--space-6);text-align:left}
.auth-form label{display:grid;gap:var(--space-2);min-width:0;color:var(--muted);font-size:var(--text-xs);font-weight:600;line-height:var(--leading-tight)}
.auth-main input{width:100%;min-width:0;min-height:var(--control-h);padding:var(--space-2) var(--space-3);border:1px solid #c5d3df;border-radius:var(--radius-xs);background:var(--surface);color:var(--ink);font-size:var(--text-base);font-weight:400}
.auth-main input:not(:disabled):hover{border-color:#a9bccb}
.auth-main input:focus-visible{border-color:var(--blue);outline-offset:0}
.auth-main input:disabled{background:#f4f6f8;color:var(--muted);cursor:not-allowed}

/* A field of the card: the label, the control and, under it, what there is to
   say about it — the error first, then the Caps Lock warning, then the hint.
   Its frame is dark enough to be seen as a frame (3.2:1 on the card), and a
   field marked wrong says so in its frame, its ground, an icon and a line of
   text, never in the colour alone. */
.auth-field{display:grid;gap:var(--space-2);min-width:0}
.auth-control{position:relative;display:flex;min-width:0}
.auth-field input{border-color:#8392a0}
.auth-field input:not(:disabled):hover{border-color:#5c6a78}
.auth-field input:focus-visible{border-color:var(--blue)}
.auth-field input[aria-invalid="true"],.auth-field input[aria-invalid="true"]:not(:disabled):hover{border-color:var(--danger);background:#fff8f6;box-shadow:inset 0 0 0 1px var(--danger)}
.auth-control.has-reveal input{padding-right:calc(var(--control-h) + var(--space-1))}
.auth-field-error,.auth-caps{display:flex;align-items:flex-start;gap:var(--space-2);font-size:var(--text-xs);font-weight:600;line-height:var(--leading-tight)}
.auth-field-error{color:var(--danger)}
.auth-caps{color:#955315}
.auth-field-error:empty,.auth-caps:empty{display:none}
.auth-field-error .auth-icon,.auth-caps .auth-icon{width:1rem;height:1rem;margin-top:.0625rem}
.auth-hint{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--space-3);color:var(--muted);font-size:var(--text-2xs);line-height:var(--leading-tight)}
.auth-count{display:inline-flex;flex:none;align-items:center;gap:var(--space-1);font-variant-numeric:tabular-nums;font-weight:600}
.auth-count.met{color:#12625c}
.auth-count .auth-icon{width:.875rem;height:.875rem;stroke-width:2.5}
.auth-main button,.auth-main .button{display:inline-flex;align-items:center;justify-content:center;gap:var(--space-2);min-height:var(--control-h-sm);padding:0 var(--space-4);border:1px solid #c5d3df;border-radius:var(--radius-xs);background:var(--surface);color:var(--ink);font-size:var(--text-sm);font-weight:600;line-height:1.2;text-decoration:none;white-space:nowrap}
.auth-main button:not(:disabled):hover,.auth-main .button:hover{border-color:#b6cfe2;background:var(--blue-soft);color:var(--ink)}
.auth-main button:disabled{opacity:.55;cursor:not-allowed}
.auth-main button.primary{min-height:var(--control-h);border-color:var(--blue);background:var(--blue);color:#fff;font-size:var(--text-base)}
.auth-main button.primary:not(:disabled):hover{border-color:#00589e;background:#00589e;color:#fff}
.auth-main button.danger{color:var(--danger)}
.auth-main button.danger:not(:disabled):hover{border-color:#e6bdb6;background:#fdf1ef;color:var(--danger)}
/* A submission on its way: the button says so and keeps the focus it had. */
.auth-main button.primary[aria-disabled="true"]{cursor:progress}
.auth-main button.primary.pending::before{content:"";flex:none;width:1rem;height:1rem;border:2px solid rgba(255,255,255,.45);border-top-color:#fff;border-radius:50%;animation:auth-spin .7s linear infinite}
/* The button that shows a password sits inside the field it belongs to. */
.auth-main .auth-reveal{position:absolute;top:2px;right:2px;bottom:2px;width:var(--control-h);min-height:0;padding:0;border:0;border-radius:calc(var(--radius-xs) - 2px);background:none;color:var(--muted)}
.auth-main .auth-reveal:focus-visible{outline-offset:-3px}
.auth-reveal [data-icon="eyeOff"],.auth-reveal[data-visible] [data-icon="eye"]{display:none}
.auth-reveal[data-visible] [data-icon="eyeOff"]{display:block}
.auth-panel .auth-links{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:var(--space-3) var(--space-4);margin-top:var(--space-5)}
.auth-panel .auth-links + p{margin-top:var(--space-4);font-size:var(--text-xs)}

/* The way to the administrator is the company's Slack: its mark in its own
   colours, on white, and beside it the way in for whoever uses Slack in the
   browser. */
.auth-main .slack-button{display:flex;gap:var(--space-3);min-height:var(--control-h);margin-top:var(--space-6);border-color:#8392a0;font-size:var(--text-base);box-shadow:0 1px 2px rgba(30,49,66,.08)}
.auth-main .slack-button:hover{border-color:#5c6a78;background:#f8fafb}
.slack-button .auth-icon{width:1.375rem;height:1.375rem}
.auth-panel .auth-fine{margin-top:var(--space-3);font-size:var(--text-xs)}
.auth-fine a{display:inline-flex;align-items:center;gap:var(--space-1)}
.auth-fine .auth-icon{width:.875rem;height:.875rem;stroke-width:2}

/* The administration answers in a note under its tables; the card answers
   inside itself, so here the line is nothing until it has something to say. */
.auth-status{min-height:1.5rem;margin:var(--space-4) 0 0;color:var(--teal);font-size:var(--text-sm);text-align:center;overflow-wrap:anywhere}
.auth-status:empty{display:none}
.auth-status.error{color:var(--danger)}
.auth-status a{margin-left:var(--space-2)}

/* Administration of accounts: a page of the application, not a card. The
   heading, the panels and the tables follow the dashboard's own. */
.auth-main.admin-main{width:min(100% - 2*var(--space-6),var(--content-max));margin:var(--space-8) auto var(--space-10)}
.admin-main .auth-card{padding:0;border:0;border-radius:0;background:none;box-shadow:none}
.admin-main .auth-logo{display:none}
.admin-main .auth-panel{text-align:left}
.admin-heading{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:var(--space-4) var(--space-6);margin-bottom:var(--space-6)}
.admin-heading h1{font-size:clamp(1.75rem,1.2rem + 1.5vw,2.25rem);line-height:1.15;letter-spacing:-.03em}
.admin-heading p{max-width:60rem;font-size:var(--text-md);line-height:var(--leading-loose)}
.admin-toolbar{display:flex;flex-wrap:wrap;gap:var(--space-2)}
.admin-panel{margin:0 0 var(--section-gap);border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);box-shadow:var(--shadow);overflow:hidden}
.admin-panel h2{display:flex;align-items:center;gap:var(--space-2);margin:0;padding:var(--space-5) var(--space-5) var(--space-4);border-bottom:1px solid #edf1f3;font-size:var(--text-xl);line-height:var(--leading-tight);letter-spacing:-.015em}
.admin-count{padding:.125rem var(--space-2);border-radius:99px;background:#eef2f5;color:#53616d;font-size:var(--text-2xs);font-weight:700;letter-spacing:0;line-height:1.35}
.admin-form{grid-template-columns:minmax(0,26rem) auto;align-items:end;justify-content:start;padding:var(--space-5)}
.admin-table-wrap{overflow-x:auto}
.admin-main table{width:100%;border-collapse:collapse;font-size:var(--text-sm)}
.admin-main th{padding:var(--space-3) var(--space-4);background:#f8fafb;color:var(--muted);font-size:var(--text-2xs);font-weight:700;letter-spacing:.04em;text-align:left;text-transform:uppercase;white-space:nowrap}
.admin-main td{padding:var(--space-3) var(--space-4);border-top:1px solid #edf1f3;line-height:1.4;vertical-align:top;overflow-wrap:break-word}
.admin-main th:first-child,.admin-main td:first-child{padding-left:var(--space-5)}
.admin-main th:last-child,.admin-main td:last-child{padding-right:var(--space-5)}
.admin-main td small{display:block;margin-top:.125rem;color:var(--muted);font-size:var(--text-2xs);white-space:nowrap}
.admin-account strong{display:block;max-width:22rem;font-weight:600}
.admin-main td .admin-role{color:var(--blue);font-weight:700}
.admin-when{white-space:nowrap;font-variant-numeric:tabular-nums}
.status-chip{display:inline-flex;align-items:center;padding:.1875rem var(--space-2);border-radius:99px;background:#eef2f5;color:#53616d;font-size:var(--text-2xs);font-weight:700;line-height:1.35;white-space:nowrap}
.status-chip.active{background:#e3f3ef;color:#12625c}
.status-chip.pending{background:#fff1df;color:#955315}

/* The four actions of an account in two groups, access and standing: side by
   side while the row has room, one over the other when it does not. */
.admin-actions{display:flex;flex-wrap:wrap;gap:var(--space-2) var(--space-4);min-width:20rem}
.admin-action-group{display:flex;flex-wrap:wrap;gap:var(--space-2)}
.admin-main .admin-actions button{min-height:2rem;padding:0 var(--space-3);font-size:var(--text-2xs)}

/* Disabled accounts remain readable and actionable, with quieter neutral
   colors and lighter emphasis than the active accounts above them. */
.admin-main .admin-account-disabled td{background:#f5f7f8;color:var(--muted)}
.admin-main .admin-account-disabled .admin-account strong,.admin-main .admin-account-disabled td .admin-role,.admin-main .admin-account-disabled .status-chip{font-weight:500}
.admin-main .admin-account-disabled td .admin-role{color:var(--muted)}
.admin-main .admin-account-disabled .admin-actions button{background:#f8fafb;color:var(--muted);font-weight:500}
.admin-main .admin-account-disabled .admin-actions button:not(:disabled):hover{border-color:#8998a6;background:#e7ebee;color:var(--ink)}
.admin-events{max-height:24rem;overflow:auto}
.admin-events th{position:sticky;top:0}
.admin-events th:nth-child(n+3){width:30%}

/* An action can be many rows down the page: its answer stays in sight at the
   foot of the window instead of waiting under the last table. */
.admin-main .auth-status{position:sticky;bottom:var(--space-4);z-index:5;width:fit-content;max-width:100%;min-height:0;margin:var(--space-4) auto 0;padding:var(--space-3) var(--space-5);border:1px solid var(--border);border-left:4px solid var(--teal);border-radius:var(--radius-xs);background:var(--surface);box-shadow:0 8px 24px rgba(30,49,66,.16);color:var(--ink);text-align:left}
.admin-main .auth-status.error{border-left-color:var(--danger);color:var(--danger)}
.admin-main .auth-status:empty{display:none}

@media(prefers-reduced-motion:reduce){.auth-alert{animation:none}.auth-loading::before,.auth-main button.primary.pending::before{animation-duration:2s}}
@media(max-width:640px){.auth-card{padding:var(--space-8) var(--space-5) var(--space-6)}.auth-main.admin-main{width:calc(100% - 2*var(--space-4));margin-top:var(--space-5)}.admin-form{grid-template-columns:1fr}.admin-heading{align-items:flex-start;flex-direction:column}}
