/* ============================================================================================================
   errors.css — Wave 2 (2026-10-25): reasons for disabled actions, screen crash card, lost-connection bar,
   reconnect dialog and the plain error pages. Loaded after app.css from App.razor; uses the app's palette tokens.
   ============================================================================================================ */

/* 1. Reason for a disabled action (ReasonHint): a visible one-line note right after the button group.
      A disabled button is not focusable and shows no tooltip on a phone — the text itself must be on screen. */
.hint[data-reason]{display:block;font-size:12px;font-weight:500;color:var(--muted);margin:2px 0 6px;line-height:1.5}
.hints{display:flex;flex-wrap:wrap;gap:0 14px;flex:1 1 100%}
.hints .hint[data-reason]{display:inline-block;margin:0 0 4px}
.doc-toolbar .hints,.screen-toolbar .hints,.action-panel .hints,.modal-actions .hints,.dc-confirm-bar .hints{flex:1 1 100%}
.btn[disabled][title],.btn:disabled[title]{cursor:not-allowed}
.btn[aria-disabled="true"]{opacity:.45;cursor:not-allowed}

/* 2. One screen crashed (ScreenErrorBoundary): an Arabic card in place of that screen only; the other tabs keep working. */
.screen-crash{display:flex;gap:12px;align-items:flex-start;margin:16px;padding:16px 18px;border-radius:var(--r,10px);
  background:var(--danger-bg,#fbeaea);color:var(--danger,#c02a2a);border:1px solid var(--danger-bd,#ecc2c2)}
.screen-crash .ic{flex:0 0 auto;margin-top:2px}
.screen-crash-body{display:flex;flex-direction:column;gap:6px;min-width:0}
.screen-crash-body b{font-size:15px}
.screen-crash-body p{margin:0;color:var(--text,#1d2a35);font-size:13px;line-height:1.6}
.screen-crash-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:4px}

/* 3. The circuit is gone (an unhandled server error, a lost connection the reconnect gave up on): Blazor shows this bar. */
#blazor-error-ui{display:none;position:fixed;inset-inline:0;bottom:0;z-index:1000;box-sizing:border-box;width:100%;
  padding:12px 48px 12px 16px;background:var(--warn-bg,#fff6d6);color:var(--text,#1d2a35);border-top:1px solid var(--warn-bd,#f0d890);
  box-shadow:0 -1px 4px rgba(0,0,0,.15);font-size:14px;line-height:1.6;text-align:start}
#blazor-error-ui .msg{display:inline}
#blazor-error-ui .reload{display:inline-block;margin-inline-start:10px;padding:4px 14px;border-radius:var(--r-sm,6px);
  background:var(--accent,#0f766e);color:#fff;font-weight:700;text-decoration:none}
#blazor-error-ui .dismiss{cursor:pointer;position:absolute;inset-inline-end:14px;top:8px;font-size:20px;line-height:1}

/* 4. Reconnecting (ReconnectModal): Blazor toggles the state classes on the dialog; the text is Arabic. */
.components-reconnect-first-attempt-visible,.components-reconnect-repeated-attempt-visible,.components-reconnect-failed-visible,
.components-pause-visible,.components-resume-failed-visible,.components-rejoining-animation{display:none}
#components-reconnect-modal.components-reconnect-show .components-reconnect-first-attempt-visible,
#components-reconnect-modal.components-reconnect-show .components-rejoining-animation,
#components-reconnect-modal.components-reconnect-paused .components-pause-visible,
#components-reconnect-modal.components-reconnect-resume-failed .components-resume-failed-visible,
#components-reconnect-modal.components-reconnect-retrying,
#components-reconnect-modal.components-reconnect-retrying .components-reconnect-repeated-attempt-visible,
#components-reconnect-modal.components-reconnect-retrying .components-rejoining-animation,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-failed .components-reconnect-failed-visible{display:block}
#components-reconnect-modal{background:var(--surface,#fff);color:var(--text,#1d2a35);width:22rem;max-width:92vw;margin:20vh auto;padding:1.6rem 1.8rem;
  border:0;border-radius:var(--r-lg,14px);box-shadow:0 6px 24px rgba(0,0,0,.25);font-family:inherit}
#components-reconnect-modal::backdrop{background:rgba(16,34,46,.5)}
.components-reconnect-container{display:flex;flex-direction:column;align-items:center;gap:.8rem}
#components-reconnect-modal p{margin:0;text-align:center;font-size:14px;line-height:1.7}
#components-reconnect-modal button{border:0;background:var(--accent,#0f766e);color:#fff;padding:6px 26px;border-radius:var(--r-sm,6px);font-weight:700;font-family:inherit;cursor:pointer}
#components-reconnect-modal button:hover{filter:brightness(.92)}
.components-rejoining-animation{position:relative;width:64px;height:64px}
.components-rejoining-animation div{position:absolute;border:3px solid var(--accent,#0f766e);opacity:1;border-radius:50%;animation:components-rejoining-animation 1.5s cubic-bezier(0,.2,.8,1) infinite}
.components-rejoining-animation div:nth-child(2){animation-delay:-.5s}
@keyframes components-rejoining-animation{0%,4.9%{top:32px;left:32px;width:0;height:0;opacity:0}5%{top:32px;left:32px;width:0;height:0;opacity:1}100%{top:0;left:0;width:64px;height:64px;opacity:0}}

/* 5. The plain pages (/Error, /not-found): a centred card, no technical detail. */
.err-page{min-height:70vh;display:flex;align-items:center;justify-content:center;padding:24px}
.err-card{max-width:520px;width:100%;background:var(--surface,#fff);border:1px solid var(--border,#dde3e8);border-radius:var(--r-lg,14px);
  padding:28px 30px;box-shadow:var(--sh-1,0 1px 3px rgba(0,0,0,.08));display:flex;flex-direction:column;gap:12px;text-align:start}
.err-card h1{margin:0;font-size:20px;display:flex;align-items:center;gap:10px}
.err-card p{margin:0;line-height:1.7;color:var(--text,#1d2a35)}
.err-card .ref{font-size:12px;color:var(--muted,#6a7785)}
.err-card .actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:6px}
