:root {
  font-family: "IBM Plex Sans Arabic", Tahoma, sans-serif;
  background: #fff;
  color: #350a13;
  --red: #be1630;
  --red-dark: #9c0e27;
  --muted: #75505a;
  --line: #eed8dd;
  --wash: #fff4f6;
  --digits: Inter, system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { min-height: 100dvh; margin: 0; display: grid; grid-template-rows: 1fr; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }
.primary span { font-family: var(--digits); }
main { display: grid; place-items: center; padding: 2rem 1.25rem 1rem; }
.auth { width: min(100%, 450px); }
.brand { display: grid; justify-items: center; gap: .15rem; width: max-content; margin: 0 auto 1.65rem; border-radius: 12px; }
.brand-logo { display: block; width: clamp(112px, 34vw, 156px); height: auto; border-radius: 18px; }
.brand-mark { display: grid; place-items: center; width: 64px; aspect-ratio: 1; margin-bottom: .52rem; color: white; background: var(--red); border-radius: 19px; box-shadow: 0 0 0 6px var(--wash), 0 8px 20px #be163024; }
.brand-mark svg { width: 36px; }
.brand-word { font-size: 2.2rem; font-weight: 700; letter-spacing: -.045em; line-height: 1.06; }
.brand-word span { color: var(--red); }
.brand-english { color: var(--red-dark); direction: ltr; font: 700 .61rem/1.4 var(--digits); letter-spacing: .19em; }
.auth-card { padding: 1.8rem 1.7rem; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: 0 14px 40px #8b09240b; }
.intro { text-align: center; margin-bottom: 1.45rem; }
h1 { font-size: clamp(1.65rem, 5.5vw, 2.15rem); font-weight: 700; line-height: 1.22; letter-spacing: -.025em; }
.intro p { margin-top: .55rem; color: var(--muted); font-size: .98rem; line-height: 1.6; }
label { display: block; margin-bottom: .45rem; font-weight: 600; }
.phone-field, .name-field { width: 100%; min-height: 56px; border: 1px solid #d5b7be; border-radius: 12px; background: #fff; }
.name-field { padding: .75rem; margin-bottom: 1rem; }
.phone-field { display: flex; align-items: stretch; }
.phone-field + label { margin-top: 1rem; }
.phone-field:focus-within, .name-field:focus { border-color: var(--red); outline: 0; box-shadow: 0 0 0 3px #be163021; }
.country { position: relative; display: flex; align-items: center; justify-content: center; gap: .3rem; flex: none; min-width: 86px; padding-inline: .7rem; border-right: 1px solid var(--line); background: var(--wash); color: var(--red-dark); border-radius: 11px 0 0 11px; }
.country:has(select:focus-visible) { outline: 2px solid var(--red); outline-offset: -3px; }
.dial { font: 700 .87rem var(--digits); }
.country svg { width: 15px; }
.country select { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.phone-field input { width: 100%; min-width: 0; border: 0; border-radius: 0 11px 11px 0; padding: .75rem; font: 500 1rem var(--digits); background: transparent; outline: 0; }
input::placeholder { color: #8c6972; opacity: 1; }
.error { margin-top: .5rem; color: var(--red-dark); font-size: .86rem; font-weight: 600; }
.phone-field:has([aria-invalid="true"]), .name-field[aria-invalid="true"] { border-color: var(--red); }
.primary { display: flex; align-items: center; justify-content: center; gap: .65rem; min-height: 54px; width: 100%; margin-top: 1.15rem; padding: .6rem .75rem; border: 1px solid transparent; border-radius: 12px; background: var(--red); color: #fff; font-weight: 700; text-align: center; }
.primary:hover { background: var(--red-dark); }
.primary:disabled { opacity: .65; cursor: wait; }
footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
footer { display: flex; align-items: center; justify-content: center; gap: .6rem; padding: .5rem 1rem 1rem; color: var(--red-dark); font-size: .82rem; }
footer a { display: inline-flex; align-items: center; min-height: 44px; }
dialog { width: min(100% - 2rem, 420px); padding: 1rem 1.2rem 1.35rem; border: 1px solid var(--line); border-radius: 16px; color: inherit; background: white; }
dialog::backdrop { background: #350a1366; }
.legal-heading { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: .5rem; }
.legal-heading h2 { font-size: 1.25rem; }
dialog p { color: var(--muted); }
.close { width: 44px; height: 44px; border: 0; border-radius: 9px; color: var(--red-dark); background: var(--wash); font-size: 1.35rem; }
@media (max-width: 520px) {
  main { align-items: center; padding: 1.75rem 1.25rem .65rem; }
  .brand { margin-bottom: 1.45rem; }
  .auth-card { padding: 1.35rem .95rem; border-radius: 18px; }
  .intro { margin-bottom: 1.1rem; }
  footer { padding-bottom: max(.55rem, env(safe-area-inset-bottom)); }
}

.staff-signin { display: inline-block; margin-top: .85rem; color: var(--red-dark); text-decoration: underline; text-underline-offset: 3px; }
