/*
 * Staff sign-in pages (dashboard/auth/layout.blade.php): the brand panel
 * beside the form. Stands alone — no Bootstrap, no dashboard template.
 * Brand palette: gold #B08C50 (#CFA96A on dark), charcoal #1B1915,
 * ivory #F4EFE7. Logical properties throughout, so Arabic mirrors itself.
 */

:root {
  --gold: #b08c50;
  --gold-deep: #94733d;
  --gold-light: #cfa96a;
  --charcoal: #1b1915;
  --ink: #23201b;
  --muted: #6f685d;
  --line: #e4ddd1;
  --ivory: #f4efe7;
  --paper: #fffdf9;
  --danger: #b4382f;
  --ok: #2f7a4f;
  --font: Inter, Rubik, "Segoe UI", Tahoma, sans-serif;
  color-scheme: light;
}

html:lang(ar) {
  --font: Rubik, "Segoe UI", Tahoma, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.auth {
  margin: 0;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 992px) {
  body.auth {
    grid-template-columns: minmax(420px, 46%) minmax(0, 1fr);
  }
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- Brand panel ---------------------------------------------------- */

.auth-brand {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 1.5rem 1.5rem 1.75rem;
  color: #f4efe7;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(207, 169, 106, 0.22), transparent 55%),
    radial-gradient(90% 70% at 0% 100%, rgba(176, 140, 80, 0.16), transparent 60%),
    var(--charcoal);
}

/* A fine grid, fading out towards the bottom. */
.auth-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(244, 239, 231, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 239, 231, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, #000 10%, transparent 85%);
}

.auth-brand__mark {
  position: absolute;
  z-index: -1;
  inset-block-end: -12%;
  inset-inline-end: -10%;
  width: min(62%, 420px);
  height: auto;
  color: var(--gold-light);
  opacity: 0.07;
}

.auth-brand__logo {
  display: inline-flex;
  color: #fff;
}

.auth-brand__slogan {
  margin: 0.6rem 0 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-light);
}

html:lang(ar) .auth-brand__slogan {
  letter-spacing: 0.04em;
  font-size: 0.85rem;
}

.auth-brand__body,
.auth-brand__foot {
  display: none;
}

@media (min-width: 992px) {
  .auth-brand {
    position: sticky;
    top: 0;
    height: 100dvh;
    padding: 3rem clamp(2.5rem, 5vw, 4.5rem);
    justify-content: space-between;
  }

  .auth-brand__body {
    display: block;
    max-width: 30rem;
  }

  .auth-brand__foot {
    display: block;
    margin: 0;
    font-size: 0.8rem;
    color: rgba(244, 239, 231, 0.5);
  }
}

.auth-brand__eyebrow {
  margin: 0 0 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold-light);
}

.auth-brand__eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
}

.auth-brand__title {
  margin: 0;
  font-size: clamp(2rem, 3.2vw, 2.75rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
  text-wrap: balance;
}

html:lang(ar) .auth-brand__title {
  line-height: 1.35;
  letter-spacing: 0;
}

.auth-brand__lead {
  margin: 1rem 0 2.25rem;
  font-size: 1.02rem;
  color: rgba(244, 239, 231, 0.72);
  max-width: 26rem;
}

.auth-brand__points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}

.auth-brand__points li {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.95rem;
  color: rgba(244, 239, 231, 0.88);
}

.auth-chip {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: var(--gold-light);
  background: rgba(207, 169, 106, 0.12);
  border: 1px solid rgba(207, 169, 106, 0.22);
  font-size: 17px;
}

/* ---- Form side ------------------------------------------------------ */

.auth-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 1.25rem 2rem;
  min-height: 100%;
}

.auth-main__bar {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1.5rem;
}

@media (min-width: 992px) {
  .auth-main {
    padding: 2rem 3rem 2.5rem;
  }

  .auth-main__bar {
    margin-bottom: 0;
  }
}

.auth-lang {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.35rem 0.25rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 0.82rem;
}

html[dir="rtl"] .auth-lang {
  padding: 0.25rem 0.75rem 0.25rem 0.35rem;
}

.auth-lang > i {
  color: var(--muted);
  margin-inline-end: 0.2rem;
}

.auth-lang a {
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.auth-lang a:hover {
  color: var(--ink);
}

.auth-lang a[aria-current] {
  background: var(--charcoal);
  color: #fff;
  font-weight: 600;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  margin-block: auto;
  padding: 2rem 1.5rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(27, 25, 21, 0.04), 0 18px 48px -24px rgba(27, 25, 21, 0.22);
  animation: auth-rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@media (min-width: 576px) {
  .auth-card {
    padding: 2.5rem 2.25rem;
  }
}

@keyframes auth-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

.auth-head {
  margin-bottom: 1.75rem;
}

.auth-head__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  border-radius: 14px;
  background: rgba(176, 140, 80, 0.12);
  color: var(--gold-deep);
  font-size: 22px;
}

.auth-head h2 {
  margin: 0;
  font-size: 1.6rem;
  line-height: 1.25;
  font-weight: 700;
  color: var(--charcoal);
}

.auth-head p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.93rem;
}

/* Fields */

.auth-field {
  margin-bottom: 1.15rem;
}

.auth-field label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
}

.auth-field__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.auth-input {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input > i {
  position: absolute;
  inset-inline-start: 0.95rem;
  color: #a39a8c;
  font-size: 17px;
  pointer-events: none;
  transition: color 0.2s ease;
}

.auth-input input {
  width: 100%;
  height: 50px;
  /* Room for the icon on one side and the reveal button on the other; the
     inputs are written left to right even on an Arabic page. */
  padding: 0 2.9rem;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d9d1c3;
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-input--plain input {
  padding: 0 1rem;
}

.auth-input input:hover {
  border-color: #c4b9a6;
}

.auth-input input:focus-visible,
.auth-input input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(176, 140, 80, 0.18);
}

.auth-input:focus-within > i {
  color: var(--gold-deep);
}

.auth-input.is-invalid input {
  border-color: var(--danger);
}

.auth-input.is-invalid input:focus {
  box-shadow: 0 0 0 4px rgba(180, 56, 47, 0.14);
}

input.auth-code {
  text-align: center;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.35em;
  font-variant-numeric: tabular-nums;
}

.auth-reveal {
  position: absolute;
  inset-inline-end: 0.35rem;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #8f8676;
  font-size: 17px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.auth-reveal:hover {
  background: var(--ivory);
  color: var(--ink);
}

.auth-reveal:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

/* Remember me */

.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.15rem 0 1.5rem;
  font-size: 0.9rem;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}

.auth-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--gold);
  cursor: pointer;
}

/* Button */

.auth-btn {
  width: 100%;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, #b99659, var(--gold) 55%, var(--gold-deep));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 10px 24px -12px rgba(148, 115, 61, 0.9);
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.auth-btn:hover {
  filter: brightness(1.05);
}

.auth-btn:active {
  transform: scale(0.985);
}

.auth-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(176, 140, 80, 0.35);
}

.auth-btn > i {
  font-size: 18px;
  transition: transform 0.2s ease;
}

.auth-btn:hover > i {
  transform: translateX(3px);
}

html[dir="rtl"] .auth-btn:hover > i {
  transform: translateX(-3px);
}

.auth-btn:disabled {
  cursor: progress;
  filter: saturate(0.7);
  opacity: 0.85;
}

.auth-btn.is-busy > i {
  display: none;
}

.auth-btn.is-busy::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
}

@keyframes auth-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Links, notes and messages */

.auth-link {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--gold-deep);
  text-decoration: none;
  border-radius: 4px;
}

.auth-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-link:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.auth-link--muted {
  color: var(--muted);
}

.auth-aside {
  margin: 1.25rem 0 0;
  font-size: 0.86rem;
  color: var(--muted);
  text-align: center;
}

.auth-back {
  margin: 1.25rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  text-align: center;
}

.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.auth-alert > i {
  flex: none;
  margin-top: 0.15rem;
  font-size: 16px;
}

.auth-alert--error {
  color: #8f2a23;
  background: #fbeeec;
  border: 1px solid #f1cfca;
}

.auth-alert--ok {
  color: #22603d;
  background: #edf6f0;
  border: 1px solid #cde5d6;
}

.auth-note {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1.5rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
