/* Rawahel KPI Portal: sign-in. Full-screen photo, everything centred. */
:root {
  --ink: #1b1c1e; --gold: #b1916d; --gold-deep: #8a6d4b; --gold-soft: #d7c3a9; --gold-light: #ecdcc4;
  --bad: #ffb4b4;
  --font: "A Jannat LT", "IBM Plex Sans Arabic", "Aptos", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body.lp { margin: 0; min-height: 100vh; font-family: var(--font); color: #f5efe6; background: #0f1012; overflow-x: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; direction: rtl; text-align: center; }
html[dir="ltr"] body.lp { font-family: "Aptos", "IBM Plex Sans Arabic", "Segoe UI", system-ui, sans-serif; }
html[dir="ltr"] body.lp :is(h1, h2, p, span, label, input, button, li) { direction: ltr; unicode-bidi: plaintext; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- full-screen background ---------- */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: radial-gradient(1200px 700px at 70% 20%, #2a2620 0%, #121315 60%); }
.bg-photo { position: absolute; inset: -4%; width: 108%; height: 108%; object-fit: cover; opacity: 0; transition: opacity 1.6s ease; transform-origin: 50% 60%; }
.bg-photo.on { opacity: 1; animation: kenburns 30s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1) translate(0, 0); } to { transform: scale(1.12) translate(-2%, -1.5%); } }
.bg-shade { position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 48%, rgba(12,13,15,.35) 0%, rgba(12,13,15,.78) 70%, rgba(12,13,15,.94) 100%),
              linear-gradient(180deg, rgba(12,13,15,.55) 0%, rgba(12,13,15,.15) 35%, rgba(12,13,15,.85) 100%); }
.bg-glow { position: absolute; inset: -20%; background: radial-gradient(30% 25% at 50% 42%, rgba(215,195,169,.22), transparent 70%);
  animation: breathe 9s ease-in-out infinite; mix-blend-mode: screen; }
@keyframes breathe { 0%, 100% { opacity: .6; transform: scale(1); } 50% { opacity: 1; transform: scale(1.08); } }
.bg-curves { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
.bg-curves path { fill: none; stroke: #c9a87f; stroke-width: 1.2; stroke-dasharray: 2400; stroke-dashoffset: 2400; animation: draw 3.6s cubic-bezier(.3,.6,.2,1) forwards; }
.bg-curves path:nth-child(2) { animation-delay: .3s; opacity: .6; } .bg-curves path:nth-child(3) { animation-delay: .6s; opacity: .45; } .bg-curves path:nth-child(4) { animation-delay: .9s; opacity: .3; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.sparks i { position: absolute; bottom: -10px; width: 3px; height: 3px; border-radius: 50%; background: #f0dcbc; box-shadow: 0 0 10px 2px rgba(226,201,163,.55); opacity: 0; animation: spark 11s linear infinite; }
.sparks i:nth-child(1) { left: 6%; } .sparks i:nth-child(2) { left: 17%; animation-delay: 2.1s; } .sparks i:nth-child(3) { left: 29%; animation-delay: 4.4s; }
.sparks i:nth-child(4) { left: 38%; animation-delay: 1.2s; } .sparks i:nth-child(5) { left: 52%; animation-delay: 6s; } .sparks i:nth-child(6) { left: 61%; animation-delay: 3.3s; }
.sparks i:nth-child(7) { left: 72%; animation-delay: 7.4s; } .sparks i:nth-child(8) { left: 81%; animation-delay: .6s; } .sparks i:nth-child(9) { left: 90%; animation-delay: 5.2s; } .sparks i:nth-child(10) { left: 96%; animation-delay: 8.6s; }
@keyframes spark { 0% { transform: translateY(0); opacity: 0; } 10% { opacity: .85; } 85% { opacity: .35; } 100% { transform: translate(14px, -105vh); opacity: 0; } }

/* ---------- centred stage ---------- */
.stage { position: relative; z-index: 1; width: min(100%, 560px); padding: 72px 20px 84px; display: flex; flex-direction: column; align-items: center; }
.logo { width: clamp(92px, 9vw, 120px); height: auto; filter: drop-shadow(0 12px 34px rgba(0,0,0,.55)); animation: logoIn 1.1s .1s cubic-bezier(.2,.8,.2,1) both; }
@keyframes logoIn { from { opacity: 0; transform: scale(.86) translateY(10px); } to { opacity: 1; transform: none; } }
.kicker { margin: 18px 0 6px; color: var(--gold-soft); font-weight: 600; letter-spacing: .5px; font-size: 15px; animation: rise .8s .35s cubic-bezier(.2,.7,.2,1) both; }
h1 { margin: 0 0 10px; font-size: clamp(36px, 5vw, 56px); line-height: 1.1; font-weight: 700;
  background: linear-gradient(100deg, #fdf8f0 0%, #e6cda6 28%, #fdf8f0 52%, #c9a87f 100%); background-size: 230% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  clip-path: inset(0 0 0 100%); animation: reveal 1.2s .45s cubic-bezier(.7,0,.2,1) forwards, shimmer 8s 2s ease-in-out infinite; }
@keyframes reveal { to { clip-path: inset(0 0 0 0); } }
@keyframes shimmer { 0%, 100% { background-position: 0% 0; } 50% { background-position: 100% 0; } }
.tag { margin: 0 0 28px; color: #d9d2c7; font-size: clamp(15px, 1.4vw, 18px); line-height: 1.6; max-width: 46ch; animation: rise .8s .65s cubic-bezier(.2,.7,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- glass sign-in card ---------- */
.card { position: relative; width: min(100%, 420px); padding: 32px 30px 24px; border-radius: 26px;
  background: linear-gradient(160deg, rgba(255,255,255,.14), rgba(255,255,255,.05)); border: 1px solid rgba(236,220,196,.22);
  backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 40px 100px rgba(0,0,0,.55), 0 1px 0 rgba(255,255,255,.18) inset;
  transition: transform .25s ease-out; transform-style: preserve-3d; animation: cardIn 1s .8s cubic-bezier(.2,.8,.2,1) both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(28px) scale(.97); filter: blur(10px); } to { opacity: 1; transform: none; filter: none; } }
.card::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: conic-gradient(from var(--ang, 0deg), transparent 0deg, #ecdcc4 40deg, transparent 90deg, transparent 220deg, #c9a87f 260deg, transparent 310deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: orbit 7s linear infinite; opacity: .9; }
@property --ang { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes orbit { to { --ang: 360deg; } }
.card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 0%), rgba(236,220,196,.16), transparent 60%); }
.card > * { position: relative; z-index: 1; }
.card h2 { margin: 0 0 4px; font-size: 24px; color: #fff; }
.sub { margin: 0 0 22px; color: #cfc8bd; font-size: 14.5px; }

.fld { position: relative; margin-bottom: 14px; }
.fld input { width: 100%; font: inherit; font-size: 16px; color: #fff; text-align: center; background: rgba(12,13,15,.42); border: 1px solid rgba(236,220,196,.22); border-radius: 14px;
  padding: 24px 50px 8px; outline: none; transition: border-color .2s, box-shadow .2s, background .2s; }
.fld input#p { padding: 24px 88px 8px; }
.fld input:focus { border-color: var(--gold-soft); background: rgba(12,13,15,.55); box-shadow: 0 0 0 4px rgba(215,195,169,.18); }
.fld label { position: absolute; left: 0; right: 0; top: 17px; text-align: center; font-size: 15.5px; color: #bdb5a9; pointer-events: none; transition: top .18s ease, font-size .18s ease, color .18s ease; }
.fld input:focus + label, .fld input:not(:placeholder-shown) + label { top: 7px; font-size: 12px; color: var(--gold-soft); font-weight: 600; }
.fld input:-webkit-autofill + label { top: 7px; font-size: 12px; color: var(--gold-soft); font-weight: 600; }
.fld input:-webkit-autofill, .fld input:-webkit-autofill:hover, .fld input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 60px #26241f inset; box-shadow: 0 0 0 60px #26241f inset; -webkit-text-fill-color: #fff; caret-color: #fff; transition: background-color 9999s; }
.fld-ic { position: absolute; left: 16px; top: 50%; width: 20px; height: 20px; margin-top: -10px; fill: none; stroke: #c8bba8; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.eye { position: absolute; right: 10px; top: 50%; margin-top: -17px; width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; display: grid; place-items: center; }
.eye svg { width: 19px; height: 19px; fill: none; stroke: #c8bba8; stroke-width: 1.7; }
.eye:hover { background: rgba(255,255,255,.08); } .eye[aria-pressed="true"] svg { stroke: var(--gold-soft); }
.caps { margin: -4px 0 8px; font-size: 13px; color: var(--gold-soft); }
.login-error { min-height: 1.3em; margin: 2px 0 10px; color: var(--bad); font-size: 14px; }

.go { position: relative; overflow: hidden; width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; font: inherit; font-size: 17px; font-weight: 700;
  color: #1b1c1e; border: 0; border-radius: 14px; padding: 15px 18px; cursor: pointer; background: linear-gradient(135deg, #f1e3cc 0%, #d2b48b 45%, #b1916d 100%);
  box-shadow: 0 16px 36px rgba(177,145,109,.38); transition: transform .2s, box-shadow .2s; }
.go:hover { transform: translateY(-2px); box-shadow: 0 22px 46px rgba(177,145,109,.5); }
.go::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.6), transparent); transform: skewX(-18deg); animation: sheen 4.5s 2.2s ease-in-out infinite; }
@keyframes sheen { 0%, 70% { left: -60%; } 100% { left: 130%; } }
.go .spin { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(27,28,30,.25); border-top-color: #1b1c1e; animation: spin .8s linear infinite; }
.go.busy span { opacity: .35; } .go.busy .spin { display: inline-block; } .go:disabled { cursor: progress; }
@keyframes spin { to { transform: rotate(360deg); } }
.secure { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 16px 0 0; font-size: 12.5px; color: #bdb5a9; }
.secure svg { width: 15px; height: 15px; fill: none; stroke: var(--gold-soft); stroke-width: 1.8; }
.shake { animation: shake .45s cubic-bezier(.36,.07,.19,.97) both !important; }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-7px); } 40%, 60% { transform: translateX(7px); } }

/* feature line under the card */
.feats { list-style: none; margin: 26px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; animation: rise .8s 1.2s cubic-bezier(.2,.7,.2,1) both; }
.feats li { font-size: 13px; color: #e9e1d5; padding: 7px 14px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid rgba(236,220,196,.18); backdrop-filter: blur(6px); }

/* language toggle and footer */
.lang { position: fixed; top: 20px; left: 20px; z-index: 2; display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 14px; color: #f0e8dc; cursor: pointer;
  padding: 9px 16px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(236,220,196,.25); backdrop-filter: blur(8px); transition: background .2s, border-color .2s; animation: rise .6s .2s both; }
.lang:hover { background: rgba(255,255,255,.14); border-color: var(--gold-soft); }
.lang svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.foot { position: fixed; bottom: 16px; left: 0; right: 0; z-index: 1; text-align: center; font-size: 12.5px; color: rgba(236,226,212,.6); }

body.out .stage { transition: opacity .35s, transform .35s, filter .35s; opacity: 0; transform: scale(.98); filter: blur(4px); }

@media (max-width: 600px) { .stage { padding: 74px 16px 70px; } .card { padding: 26px 20px 20px; } .feats { display: none; } }
@media (max-height: 760px) and (min-width: 601px) { .stage { padding-top: 56px; } .tag { margin-bottom: 18px; } .feats { margin-top: 16px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  h1 { clip-path: none; } .bg-curves path { stroke-dashoffset: 0; } .sparks { display: none; } .bg-photo.on { opacity: 1; }
}

/* fit one screen: wider column, chips on one line, tighter spacing */
.stage { width: min(100%, 760px); padding: 48px 20px 64px; }
.logo { width: clamp(84px, 8vw, 108px); }
.kicker { margin: 12px 0 4px; }
h1 { font-size: clamp(34px, 4.4vw, 52px); white-space: nowrap; }
.tag { margin-bottom: 20px; }
.feats { margin-top: 18px; flex-wrap: nowrap; }
.feats li { white-space: nowrap; }
@media (max-width: 900px) { .feats { flex-wrap: wrap; } h1 { white-space: normal; } }
/* guidelines pass: keyboard focus, tap behaviour */
:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 3px; border-radius: 8px; }
.fld input:focus-visible { outline: none; }
button, .lang { touch-action: manipulation; }
html { -webkit-tap-highlight-color: transparent; color-scheme: dark; }
.go:active, .lang:active { transform: translateY(1px) scale(.985); }
h1, h2 { text-wrap: balance; } p { text-wrap: pretty; }
/* v50: same typeface as the portal */
:root { --font: "Readex Pro", "IBM Plex Sans Arabic", "Segoe UI", system-ui, sans-serif; }
body.lp, html[dir="ltr"] body.lp, body.lp button, body.lp input { font-family: var(--font); }
:root, html[lang="ar"] { --font: "A Jannat LT", "Jannat LT", "Readex Pro", "IBM Plex Sans Arabic", "Segoe UI", system-ui, sans-serif; }
html[lang="en"] { --font: "Aptos", "Readex Pro", "IBM Plex Sans Arabic", "Segoe UI", system-ui, sans-serif; }
