/* Fursa UI v2 — «حسابي» (account.html) and the error page (error.html).
   Loaded last in v2/base.html; every rule is scoped to html[data-ui="v2"]. */

/* -- «حسابي» ------------------------------------------------------------- */

/* A narrow page: the two cards cap at a readable column inside the page. */
html[data-ui="v2"] .fx-page--account{max-inline-size:720px}

html[data-ui="v2"] .fx-page--account .fx-account-head{
  display:grid;gap:var(--fx-space-2);justify-items:start;
  margin-block-end:var(--fx-space-5);
}
html[data-ui="v2"] .fx-page--account .fx-account-head :is(.fx-title,.fx-lede){margin:0}

/* Identity: initial avatar, email (isolated LTR), role chip pushed to the
   reading end. */
html[data-ui="v2"] .fx-page--account .fx-account-id{
  display:flex;align-items:center;gap:var(--fx-space-4);flex-wrap:wrap;
}
html[data-ui="v2"] .fx-page--account .fx-account-id__avatar{
  flex:none;display:inline-grid;place-items:center;
  inline-size:56px;block-size:56px;border-radius:50%;
  background:var(--fx-primary-soft);color:var(--fx-primary);
  font-size:var(--fx-text-xl);font-weight:var(--fx-weight-semibold);
  text-transform:uppercase;
}
html[data-ui="v2"] .fx-page--account .fx-account-id__meta{display:grid;gap:2px;min-inline-size:0}
html[data-ui="v2"] .fx-page--account .fx-account-id__meta--role{
  margin-inline-start:auto;justify-items:end;
}
html[data-ui="v2"] .fx-page--account .fx-account-id__label{
  font-size:var(--fx-text-xs);color:var(--fx-text-muted);
}
html[data-ui="v2"] .fx-page--account .fx-account-id__email{
  font-size:var(--fx-text-base);font-weight:var(--fx-weight-semibold);
  overflow-wrap:anywhere;
}
@media (max-width:640px){
  html[data-ui="v2"] .fx-page--account .fx-account-id__meta--role{
    margin-inline-start:0;justify-items:start;flex-basis:100%;
  }
}

/* Password card: the danger callout leads, fields stack, the button reads
   from the end on desktop and goes full width on phones. */
html[data-ui="v2"] .fx-page--account .fx-account-pw{margin-block-start:var(--fx-space-5)}
html[data-ui="v2"] .fx-page--account .fx-account-pw__title{
  margin:0 0 var(--fx-space-4);
  font-size:var(--fx-text-lg);font-weight:var(--fx-weight-semibold);
  line-height:var(--fx-leading-tight);
}
html[data-ui="v2"] .fx-page--account .fx-account-pw .fx-callout{margin-block-end:var(--fx-space-4)}
html[data-ui="v2"] .fx-page--account .fx-callout--muted{
  background:var(--fx-surface-sunken);border-color:var(--fx-border);
}
html[data-ui="v2"] .fx-page--account .fx-account-pw__form{display:grid;gap:var(--fx-space-4)}
html[data-ui="v2"] .fx-page--account .fx-account-pw__form .fx-field{margin:0}
html[data-ui="v2"] .fx-page--account .fx-account-pw__actions{display:flex;justify-content:flex-end}
@media (max-width:640px){
  html[data-ui="v2"] .fx-page--account .fx-account-pw__actions .fx-btn{inline-size:100%}
}

/* -- error page ----------------------------------------------------------- */

/* One quiet card, centred in the content area; the shell's .fx-page > *
   rise animation gives it the short entrance. */
html[data-ui="v2"] .fx-page--error{
  display:grid;place-items:center;
  min-block-size:max(320px, calc(100dvh - var(--fx-header-h) - 160px));
}
html[data-ui="v2"] .fx-page--error .fx-error-card{
  --fx-err-accent:var(--fx-primary);
  position:relative;overflow:hidden;
  inline-size:min(480px,100%);
  display:grid;justify-items:center;text-align:center;
  gap:var(--fx-space-3);
  padding:var(--fx-space-8) var(--fx-space-6) var(--fx-space-6);
  background:var(--fx-surface);border:1px solid var(--fx-border);
  border-radius:var(--fx-radius-xl);box-shadow:var(--fx-shadow-md);
}
html[data-ui="v2"] .fx-page--error .fx-error-card--warn{--fx-err-accent:var(--fx-warning)}
html[data-ui="v2"] .fx-page--error .fx-error-card--danger{--fx-err-accent:var(--fx-danger)}
html[data-ui="v2"] .fx-page--error .fx-error-card .fx-eyebrow{margin-block-end:var(--fx-space-1)}
/* the hero art: «الصفحة المفقودة» — an inline-SVG stack of document sheets
   (v2/_fx_error_art.html). All colour via tokens; the severity element alone
   uses --fx-err-accent. Hidden states live only in `from` keyframes with
   fill both, so the reduced-motion collapse leaves the drawing complete. */
html[data-ui="v2"] .fx-page--error .fx-error__art{display:grid;place-items:center}
html[data-ui="v2"] .fx-page--error .fx-art{
  inline-size:clamp(200px,56vw,240px);block-size:auto;overflow:visible;
}
html[data-ui="v2"][dir="rtl"] .fx-page--error .fx-art{transform:scaleX(-1)}
html[data-ui="v2"] .fx-art__dot{fill:var(--fx-border)}
html[data-ui="v2"] .fx-art__sheet{
  fill:var(--fx-surface);stroke:var(--fx-border-strong);stroke-width:1.25;
  vector-effect:non-scaling-stroke;
}
html[data-ui="v2"] .fx-art__ghost{
  fill:none;stroke:var(--fx-err-accent);stroke-width:1.25;stroke-linecap:round;
  vector-effect:non-scaling-stroke;stroke-dasharray:4 6;
  animation:fx-art-march 14s linear .9s infinite;
}
html[data-ui="v2"] .fx-art__line{fill:var(--fx-border);opacity:.55}
html[data-ui="v2"] .fx-art__titleline{fill:var(--fx-err-accent);opacity:.5}
html[data-ui="v2"] .fx-art__band{fill:color-mix(in srgb,var(--fx-err-accent) 10%,transparent)}
html[data-ui="v2"] .fx-art__seal{
  fill:none;stroke:var(--fx-err-accent);stroke-width:1.25;vector-effect:non-scaling-stroke;
}
html[data-ui="v2"] .fx-art__mark{fill:var(--fx-err-accent)}
html[data-ui="v2"] .fx-art__node{
  fill:var(--fx-surface);stroke:var(--fx-err-accent);stroke-width:1.25;
  vector-effect:non-scaling-stroke;
}
html[data-ui="v2"] .fx-art__link{
  stroke:var(--fx-border-strong);stroke-width:1.25;stroke-linecap:round;
  vector-effect:non-scaling-stroke;
}
html[data-ui="v2"] .fx-art__breakdot{fill:var(--fx-err-accent)}
html[data-ui="v2"] .fx-art__pulse{
  opacity:0;animation:fx-art-pulse 3.2s var(--fx-ease-in-out) 1s infinite;
}
html[data-ui="v2"] .fx-art__float{animation:fx-art-float 6s var(--fx-ease-in-out) 1s infinite}
html[data-ui="v2"] .fx-art__breathe{
  transform-box:fill-box;transform-origin:center;
  animation:fx-art-breathe 5s var(--fx-ease-in-out) .9s infinite;
}
html[data-ui="v2"] .fx-art__rise{animation:fx-art-rise .42s var(--fx-ease-out) both}
html[data-ui="v2"] .fx-art__draw{
  stroke-dasharray:1;animation:fx-art-draw .7s var(--fx-ease-out) .15s both;
}
@keyframes fx-art-rise{from{opacity:0;transform:translateY(8px)}}
@keyframes fx-art-draw{from{stroke-dashoffset:1}to{stroke-dashoffset:0}}
@keyframes fx-art-march{to{stroke-dashoffset:-10}}
@keyframes fx-art-float{0%,100%{transform:translateY(0)}50%{transform:translateY(-2px)}}
@keyframes fx-art-breathe{0%,100%{transform:scale(1)}50%{transform:scale(1.03)}}
@keyframes fx-art-pulse{
  0%{transform:translate(0,0);opacity:0}
  14%{opacity:.95}
  72%{transform:translate(-27px,0);opacity:.95}
  100%{transform:translate(-27px,0);opacity:0}
}
html[data-ui="v2"] .fx-page--error .fx-error__code{
  font-size:var(--fx-text-4xl);font-weight:var(--fx-weight-semibold);line-height:1.15;
  color:var(--fx-text);font-variant-numeric:tabular-nums;letter-spacing:.02em;
}
html[data-ui="v2"] .fx-page--error .fx-error__title{
  margin:0;font-size:var(--fx-text-xl);font-weight:var(--fx-weight-semibold);
  line-height:var(--fx-leading-tight);color:var(--fx-text);
}
html[data-ui="v2"] .fx-page--error .fx-error__message{
  margin:0;max-inline-size:46ch;
  font-size:var(--fx-text-sm);line-height:var(--fx-leading-body);color:var(--fx-text-muted);
}
html[data-ui="v2"] .fx-page--error .fx-error__tech{
  margin:0;font-size:var(--fx-text-xs);color:var(--fx-text-subtle);
}
html[data-ui="v2"] .fx-page--error .fx-error__actions{margin-block-start:var(--fx-space-2)}

/* Centered head */
html[data-ui="v2"] .fx-page--account .fx-account-head{justify-items:center;text-align:center}
html[data-ui="v2"] .fx-page--account .fx-account-head .fx-lede{max-inline-size:60ch}
