/* ── Merhab Intro + Login ──────────────────────────────────────────────
   Used by app/Http/EntryPoints/Home/index.php (intro → login) and
   app/Http/EntryPoints/Auth/login.php (login only, no intro).

   Sizing pass (2026-08-26): all dimensions below are real, deliberate
   values — no `zoom` / `transform: scale()` anywhere in this file. The
   card/typography/controls are token-driven (--auth-* custom properties
   on .il-shell) so the whole scale can be retuned from one place. */

@keyframes ilWipe  { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }
@keyframes ilRise  { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes ilFade  { from { opacity: 0; } to { opacity: 1; } }
@keyframes ilLine  { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes ilZoom  { from { transform: scale(1.16); } to { transform: scale(1.02); } }
@keyframes ilSweep { 0% { transform: translateX(-120%); } 100% { transform: translateX(320%); } }
@keyframes ilPulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

html, body.il-body { margin: 0; height: 100%; background: #08080a; font-family: 'Tajawal', system-ui, sans-serif; overflow: hidden; }

.il-shell {
  position: fixed; inset: 0; background: #08080a; overflow: hidden; font-family: 'Tajawal', sans-serif;

  /* ── Design tokens — login page only, scoped here so nothing else
     in the app inherits them ── */
  /* 2026-08-26 pass 4: scale factor moved from ~75% to ~70% of the
     original (460/52/215-logo) baseline for card width, control
     height, radius and logo. Spacing scale + type sizes are left as
     already tuned in the previous two passes — those were separate,
     explicit fixes ("gaps too tight", "font too big"), not part of
     this scale-percentage knob. */
  --auth-card-width: 322px;
  --auth-card-pad-y: 28px;
  --auth-card-pad-x: 32px;
  --auth-control-height: 36px;
  --auth-control-radius: 9px;
  --auth-logo-size: clamp(112px, 11.2vw, 150px);

  --auth-space-1: 4px;
  --auth-space-2: 8px;
  --auth-space-3: 12px;
  --auth-space-4: 16px;
  --auth-space-5: 20px;
  --auth-space-6: 24px;
  --auth-space-7: 32px;
  --auth-space-8: 40px;
}

.il-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center; opacity: .8;
  animation: ilZoom 22s ease-out forwards;
}
.il-bg-radial {
  position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 50% 40%, rgba(8,8,10,.1) 0%, rgba(8,8,10,.68) 62%, #08080a 100%);
}
.il-bg-linear {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8,8,10,.5) 0%, transparent 28%, transparent 68%, rgba(8,8,10,.82) 100%);
}

/* ── Language switch (fixed top) — small and out of the card's way ── */
.il-langswitch {
  /* Own fixed offset (not the card-padding token) so it sits a bit off
     the corner instead of flush against it. */
  position: absolute; top: 32px; inset-inline-end: 32px; z-index: 5;
  display: flex; align-items: center; gap: 3px; padding: 3px;
  height: 26px; box-sizing: border-box;
  background: rgba(255,255,255,.06); border: 1px solid rgba(183,139,96,.28);
  border-radius: 13px; backdrop-filter: blur(14px);
}
.il-langswitch a {
  border: none; cursor: pointer; border-radius: 10px; padding-inline: 10px;
  display: inline-flex; align-items: center; height: 100%;
  font: 600 10px/1 'Tajawal', sans-serif; background: transparent; color: rgba(244,239,233,.7);
  text-decoration: none;
}
.il-langswitch a[lang="en"], .il-langswitch a[lang="fr"] { font-family: 'Poppins', sans-serif; }
.il-langswitch a.active { background: #b78b60; color: #1a1207; }

/* ── Intro stage ── */
.il-intro {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: var(--auth-space-4);
  /* Extra top padding (vs. none on bottom) nudges the centered group down
     a bit instead of sitting dead-center — a deliberate offset, not a
     leftover default. */
  padding: 16vh var(--auth-space-6) 0; text-align: center;
  transition: opacity .6s ease;
}
.il-intro.il-hidden { opacity: 0; pointer-events: none; }
.il-kicker { display: flex; align-items: center; gap: 8px; animation: ilFade 1s ease .2s both; }
.il-kicker .line { width: 22px; height: 1px; background: linear-gradient(90deg, transparent, #b78b60); }
.il-kicker .line.rev { background: linear-gradient(270deg, transparent, #b78b60); }
.il-kicker span.txt { font: 500 9.5px/1 'Poppins', sans-serif; letter-spacing: .3em; color: #c9a37c; }

.il-logo-wrap { position: relative; animation: ilWipe 1.5s cubic-bezier(.22,.8,.2,1) .5s both; }
.il-logo-wrap img { display: block; width: min(230px, 27vw); height: auto; filter: brightness(0) invert(1) drop-shadow(0 6px 26px rgba(0,0,0,.6)); }
.il-logo-wrap .sweep {
  position: absolute; top: 0; bottom: 0; width: 34px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  animation: ilSweep 1.6s ease-in-out 1.5s 1 both; mix-blend-mode: screen;
}
.il-rule { width: 120px; height: 1px; background: linear-gradient(90deg, transparent, #b78b60, transparent); animation: ilLine 1.1s ease 1.5s both; }
.il-headline { margin: 0; max-width: 420px; font-weight: 700; font-size: clamp(15px, 1.5vw, 19px); line-height: 1.4; color: #f4efe9; text-wrap: pretty; animation: ilRise .9s ease 1.8s both; }
.il-sub { margin: 0; max-width: 360px; font-weight: 300; font-size: clamp(10px, .7vw, 11.5px); line-height: 1.6; color: rgba(244,239,233,.6); text-wrap: pretty; animation: ilRise .9s ease 2.1s both; }
.il-dots { display: flex; align-items: center; gap: 6px; margin-top: var(--auth-space-2); animation: ilFade .8s ease 2.4s both; }
.il-dots span { width: 5px; height: 5px; border-radius: 50%; background: #b78b60; animation: ilPulse 1.3s ease-in-out infinite; }
.il-dots span:nth-child(2) { animation-delay: .22s; }
.il-dots span:nth-child(3) { animation-delay: .44s; }

/* ── Login stage ── */
.il-login-wrap {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  overflow-y: auto; padding: var(--auth-space-6) 0; opacity: 0; animation: ilFade .7s ease both;
}
.il-login-wrap.il-hidden { display: none; }
.il-card {
  flex: 0 0 auto; margin: auto;
  width: min(calc(100% - 32px), var(--auth-card-width));
  height: auto;
  padding: var(--auth-card-pad-y) var(--auth-card-pad-x);
  background: rgba(12,12,14,.62); backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid rgba(183,139,96,.28); border-radius: 22px;
  box-shadow: 0 28px 64px rgba(0,0,0,.5);
}
.il-card-logo { display: block; width: var(--auth-logo-size); height: auto; margin: 0 auto var(--auth-space-5); filter: brightness(0) invert(1); }
.il-card h2 { margin: 0 0 var(--auth-space-2); text-align: center; font-weight: 700; font-size: clamp(15px, 1.2vw, 18px); line-height: 1.3; color: #f4efe9; }
.il-card .il-sub2 { margin: 0 0 var(--auth-space-5); text-align: center; font-weight: 300; font-size: clamp(10px, .65vw, 11px); line-height: 1.5; color: rgba(244,239,233,.55); }

.il-field-label { display: block; font-weight: 600; font-size: clamp(10px, .6vw, 11px); line-height: 1; color: #c9a37c; margin-bottom: var(--auth-space-2); }
.il-input {
  width: 100%; height: var(--auth-control-height); box-sizing: border-box;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--auth-control-radius); padding-inline: var(--auth-space-4);
  font: 400 11.5px/1 'Tajawal', sans-serif; color: #f4efe9;
  margin-bottom: var(--auth-space-5); outline: none; transition: border-color .15s ease, background .15s ease;
  appearance: none; -webkit-appearance: none; color-scheme: dark;
}
.il-input::placeholder { color: rgba(244,239,233,.35); opacity: 1; }
.il-input:focus { border-color: #b78b60; background: rgba(183,139,96,.09); }
.il-input:focus-visible { outline: 2px solid rgba(183,139,96,.55); outline-offset: 1px; }
/* Kill the browser's blue-on-white autofill background (same trick as login.css). */
.il-input:-webkit-autofill,
.il-input:-webkit-autofill:hover,
.il-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #f4efe9;
  -webkit-box-shadow: 0 0 0 1000px #16130f inset;
  box-shadow: 0 0 0 1000px #16130f inset;
  caret-color: #f4efe9;
  transition: background-color 600000s ease-in-out 0s;
}
.il-field-pass { position: relative; margin-bottom: var(--auth-space-4); }
.il-field-pass .il-input { margin-bottom: 0; padding-inline-end: 44px; }
.il-pw-toggle {
  position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: rgba(244,239,233,.5); cursor: pointer; border-radius: 6px;
}
.il-pw-toggle:hover { color: #c9a37c; }
.il-pw-toggle:focus-visible { outline: 2px solid rgba(183,139,96,.55); outline-offset: 1px; }
.il-pw-toggle svg { width: 13px; height: 13px; }

.il-row { display: flex; align-items: center; justify-content: space-between; gap: var(--auth-space-3); flex-wrap: nowrap; margin: 0 0 var(--auth-space-5); }
.il-remember { display: flex; align-items: center; gap: var(--auth-space-2); font: 400 clamp(9.5px,.55vw,10.5px)/1 'Tajawal', sans-serif; color: rgba(244,239,233,.65); cursor: pointer; user-select: none; white-space: nowrap; }
.il-remember input { display: none; }
.il-remember .box { width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(183,139,96,.6); background: transparent; flex-shrink: 0; }
.il-remember input:checked + .box { background: #b78b60; }
.il-remember input:focus-visible + .box { outline: 2px solid rgba(183,139,96,.55); outline-offset: 1px; }
.il-forgot { font: 400 clamp(9.5px,.55vw,10.5px)/1 'Tajawal', sans-serif; color: #c9a37c; text-decoration: none; white-space: nowrap; }
.il-forgot:hover { color: #f4efe9; }
.il-forgot:focus-visible { outline: 2px solid rgba(183,139,96,.55); outline-offset: 2px; }

.il-submit {
  width: 100%; height: var(--auth-control-height); box-sizing: border-box;
  background: linear-gradient(100deg,#c9a37c,#a2764c); border: none; border-radius: var(--auth-control-radius);
  font-family: 'Cairo', 'Tajawal', sans-serif; font-weight: 700; font-size: clamp(11px, .7vw, 12px); color: #1a1207; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: var(--auth-space-2); transition: filter .15s ease;
}
.il-submit:hover { filter: brightness(1.08); }
.il-submit:focus-visible { outline: 2px solid rgba(183,139,96,.7); outline-offset: 2px; }
.il-submit:disabled { cursor: not-allowed; opacity: .85; }
.il-submit .il-spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(26,18,7,.35); border-top-color: #1a1207; animation: il-spin .7s linear infinite; }
@keyframes il-spin { to { transform: rotate(360deg); } }

.il-error {
  display: flex; align-items: center; gap: var(--auth-space-2); padding: 10px var(--auth-space-4); margin-bottom: var(--auth-space-5);
  background: rgba(125,32,32,.18); border: 1px solid rgba(190,60,60,.45); color: #e7b4b4;
  border-radius: 10px; font: 500 13px/1.4 'Tajawal', sans-serif;
}

.il-tag { margin: var(--auth-space-5) 0 0; text-align: center; font: 400 9px/1 'Poppins', sans-serif; letter-spacing: .13em; color: rgba(244,239,233,.35); }

/* ── Footer (privacy link etc) — small, never competes with the card ── */
.il-footer {
  position: absolute; bottom: var(--auth-space-3); inset-inline: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center; gap: var(--auth-space-4);
  font: 400 10.5px/1 'Tajawal', sans-serif; color: rgba(244,239,233,.4);
}
.il-footer a { color: rgba(244,239,233,.5); text-decoration: none; }
.il-footer a:hover { color: #c9a37c; }

.d-none { display: none !important; }
.il-btn-label { display: inline-flex; align-items: center; gap: var(--auth-space-2); }
.icon-svg { display: inline-block; vertical-align: middle; flex-shrink: 0; }
.icon-flip { transform: scaleX(-1); }

/* ── Short laptop screens (1366×768, 1280×720 class) — trim padding/gaps
   by height, not by shrinking the whole page with a transform ── */
@media (max-height: 800px) {
  .il-shell {
    --auth-card-pad-y: 22px;
    --auth-card-pad-x: 26px;
    --auth-control-height: 34px;
    --auth-logo-size: clamp(102px, 10.4vw, 130px);
    --auth-space-5: 16px;
    --auth-space-6: 18px;
  }
  .il-langswitch { top: 18px; }
  .il-footer { bottom: 8px; }
  .il-intro { padding-top: 8vh; }
}
@media (max-height: 620px) {
  .il-footer { display: none; }
}

/* ── Mobile ── */
@media (max-width: 480px) {
  .il-shell {
    --auth-card-width: 345px;
    --auth-card-pad-y: 20px;
    --auth-card-pad-x: 20px;
    --auth-control-height: 42px;
    --auth-logo-size: clamp(115px, 32vw, 145px);
  }
  .il-card { width: calc(100% - 32px); }
  /* 16px input font avoids Safari's auto-zoom-on-focus on iPhone. */
  .il-input { font-size: 16px; }
  .il-intro { padding-top: 10vh; }
  .il-headline { font-size: 16px; }
  .il-sub { font-size: 11px; }
  .il-langswitch { inset-inline-end: 16px; top: 16px; }
}
@media (max-width: 360px) {
  /* Remember/forgot row: let it wrap onto two lines rather than overflow
     the card on the very narrowest phones (320–360px). */
  .il-row { flex-wrap: wrap; row-gap: var(--auth-space-2); }
  .il-remember, .il-forgot { white-space: normal; }
}
