/* =====================================================================
   Auth pages (components/auth-layout.blade.php): login, register,
   password reset, email verification, two-factor, confirm password.
   Same identity as the home page: dark slate + restrained gold, hairlines.
   ===================================================================== */

@font-face {
  font-family: "MH Almarai";
  src: url(../fonts/Almarai/Almarai-Regular.ttf) format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "MH Almarai";
  src: url(../fonts/Almarai/Almarai-Bold.ttf) format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "MH Almarai";
  src: url(../fonts/Almarai/Almarai-ExtraBold.ttf) format("truetype");
  font-weight: 800;
  font-display: swap;
}

:root {
  --au-ink: #1f2937;
  --au-ink-deep: #111827;
  --au-text: #374151;
  --au-muted: #4b5563;
  --au-muted-2: #6b7280;
  --au-line: #e5e7eb;
  --au-field: #d1d5db;
  --au-paper: #ffffff;
  --au-paper-2: #f6f7f8;
  --au-gold: #c9a961;        /* on dark: 6.5:1 */
  --au-gold-deco: #a67c52;   /* rules and strokes only */
  --au-gold-text: #8a6237;   /* on white: 5.4:1 */
  --au-on-dark: #f9fafb;
  --au-on-dark-2: #cbd5e1;
  --au-on-dark-3: #9ca3af;
  --au-error: #b42318;       /* 6.1:1 on white */
  --au-error-bg: #fef3f2;
  --au-ok: #166534;
  --au-ok-bg: #f0fdf4;
}

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

html { -webkit-text-size-adjust: 100%; }

body.au-body {
  margin: 0;
  min-height: 100vh;
  background: var(--au-paper);
  color: var(--au-text);
  font-family: "MH Almarai", Tahoma, sans-serif;
  font-size: 1rem;
  line-height: 1.8;
}

.au-body h1, .au-body h2, .au-body p { margin: 0; letter-spacing: 0; }
.au-body a { color: var(--au-gold-text); }
.au-body button, .au-body input { font-family: inherit; }

.au-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.au-skip {
  position: absolute;
  top: -100px;
  right: 16px;
  z-index: 10;
  padding: 8px 14px;
  background: var(--au-gold);
  color: var(--au-ink) !important;
  font-weight: 700;
  border-radius: 3px;
}
.au-skip:focus { top: 12px; }

.au :focus { outline: none; }
.au :focus-visible {
  outline: 2px solid var(--au-gold-text);
  outline-offset: 3px;
  border-radius: 2px;
}
.au-panel :focus-visible { outline-color: var(--au-gold); }

/* ------------------------------------------------------------------ frame */
.au {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  min-height: 100vh;
}

/* ------------------------------------------------------------------ dark panel */
.au-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 40px 48px 32px;
  background: var(--au-ink);
  color: var(--au-on-dark);
  overflow: hidden;
}
.au-panel::after {            /* double gold rule on the inner edge */
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 6px;
  border-right: 1px solid rgba(201, 169, 97, 0.45);
  border-left: 2px solid var(--au-gold-deco);
}
.au-panel__bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.au-panel__rosette {
  position: absolute;
  width: 720px;
  height: 720px;
  left: -260px;
  top: -240px;
  color: var(--au-gold);
  opacity: 0.06;
}

.au-brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  align-self: flex-start;
  color: #fff !important;
  font-size: 1.25rem;
  font-weight: 800;
  text-decoration: none;
}
.au-brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--au-gold);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--au-ink), 0 0 0 4px rgba(201, 169, 97, 0.45);
  color: var(--au-gold);
  font-size: 1.05rem;
  line-height: 1;
}

.au-panel__body {
  position: relative;
  margin-top: 12vh;
  max-width: 30em;
}
.au-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--au-gold);
}
.au-kicker::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--au-gold);
  flex: none;
}
.au-panel__title {
  margin-top: 18px !important;
  font-size: clamp(1.7rem, 1rem + 1.7vw, 2.5rem);
  font-weight: 800;
  line-height: 1.45;
  color: #fff;
}
.au-panel__title span { display: block; color: var(--au-gold); }
.au-panel__lead {
  margin-top: 16px !important;
  font-size: 1.02rem;
  line-height: 1.95;
  color: var(--au-on-dark-2);
}

/* the empty roll sheet, cropped by the bottom of the panel */
.au-sheet {
  position: relative;
  flex: 1;
  min-height: 0;
  margin-top: 40px;
}
.au-sheet__paper {
  position: absolute;
  top: 0;
  right: 0;
  width: min(100%, 400px);
  padding: 24px 24px 12px;
  background: var(--au-paper);
  color: var(--au-ink);
  border-radius: 3px;
  box-shadow: 0 34px 64px -30px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.18);
  transform: rotate(-2.5deg);
  transform-origin: top right;
}
.au-sheet__paper::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(166, 124, 82, 0.38);
  pointer-events: none;
}
.au-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 4px double var(--au-ink);
}
.au-sheet__title { font-size: 1.05rem; font-weight: 800; line-height: 1.5; }
.au-sheet__date { font-size: 0.82rem; color: var(--au-muted); }
.au-seal {
  position: relative;
  width: 54px;
  height: 54px;
  flex: none;
  color: var(--au-gold-deco);
}
.au-seal svg { width: 100%; height: 100%; display: block; }
.au-seal span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(166, 124, 82, 0.55);
  border-radius: 50%;
  background: var(--au-paper);
  color: var(--au-gold-text);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1;
}
.au-sheet__row {
  display: grid;
  grid-template-columns: 36px 1.25fr 1fr 1.1fr;
  gap: 12px;
  align-items: end;
  padding: 11px 4px;
  border-bottom: 1px solid var(--au-line);
}
.au-sheet__row--head {
  padding: 8px 4px;
  border-bottom: 1px solid var(--au-ink);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--au-muted);
  line-height: 1.6;
}
.au-sheet__row--head span:first-child,
.au-sheet__num { text-align: center; }
.au-sheet__num { font-size: 0.8rem; font-weight: 700; color: var(--au-muted-2); line-height: 1.4; }
.au-sheet__row i {
  display: block;
  height: 1px;
  margin-bottom: 5px;
  border-bottom: 1px dotted #b9bec6;
}
.au-sheet__row.is-next { background: #faf6ee; box-shadow: inset -3px 0 0 var(--au-gold); }
.au-sheet__row.is-next .au-sheet__num { color: var(--au-gold-text); }

.au-panel__foot {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  padding-top: 18px;
  margin-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--au-ink);
  font-size: 0.85rem;
}
.au-panel__foot a { color: var(--au-on-dark-3); text-decoration: none; }
.au-panel__foot a:hover { color: var(--au-gold); }

/* ------------------------------------------------------------------ form column */
.au-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 32px 28px;
  background: var(--au-paper);
}
.au-form-wrap {
  width: 100%;
  max-width: 440px;
  margin: auto 0;
}
.au-copy {
  margin-top: 40px !important;
  font-size: 0.8rem;
  color: var(--au-muted-2);
}

.au-head { margin-bottom: 32px; }
.au-head .au-kicker { color: var(--au-gold-text); }
.au-head .au-kicker::before { background: var(--au-gold-deco); }
.au-title {
  margin-top: 12px !important;
  font-size: clamp(1.6rem, 1.2rem + 1vw, 2.1rem);
  font-weight: 800;
  line-height: 1.45;
  color: var(--au-ink);
}
.au-sub {
  margin-top: 8px !important;
  color: var(--au-muted);
  font-size: 1rem;
}

/* messages */
.au-status,
.au-alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 24px;
  padding: 14px 16px;
  border-radius: 3px;
  font-size: 0.95rem;
  line-height: 1.75;
}
.au-status { background: var(--au-ok-bg); border: 1px solid #bbf7d0; color: var(--au-ok); }
.au-alert { background: var(--au-error-bg); border: 1px solid #fecdca; color: var(--au-error); }
.au-status i,
.au-alert i { margin-top: 5px; }
.au-alert ul { margin: 4px 0 0; padding-inline-start: 18px; }

/* fields */
.au-form { display: grid; gap: 20px; }
.au-field { display: grid; gap: 8px; }
.au-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.au-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--au-ink);
}
.au-label-row a {
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(138, 98, 55, 0.35);
  text-underline-offset: 0.45em;
}
.au-label-row a:hover { color: #6e4d2a; text-decoration-color: currentColor; }

.au-control { position: relative; }
.au-input {
  display: block;
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 1px solid var(--au-field);
  border-radius: 3px;
  background: var(--au-paper);
  color: var(--au-ink);
  font-size: 1rem;
  line-height: 1.4;
  -webkit-appearance: none;
  appearance: none;
}
.au-input::placeholder { color: #9ca3af; }
.au-input:hover { border-color: #9ca3af; }
.au-input:focus {
  outline: none;
  border-color: var(--au-gold-text);
  box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.28);
}
.au-input--ltr { direction: ltr; text-align: right; }
.au-input--ltr::placeholder { text-align: right; }
.au-input--code { letter-spacing: 0.3em; text-align: center; font-size: 1.2rem; font-weight: 700; }
.au-input[aria-invalid="true"] { border-color: var(--au-error); }
.au-input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.18); }
.au-control--pass .au-input { padding-left: 52px; }

.au-eye {
  position: absolute;
  top: 0;
  left: 0;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--au-muted-2);
  cursor: pointer;
}
.au-eye:hover { color: var(--au-ink); }

.au-error {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 0.88rem;
  color: var(--au-error);
}
.au-hint { font-size: 0.85rem; color: var(--au-muted-2); }

/* checkbox */
.au-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--au-text);
  cursor: pointer;
}
.au-check input {
  width: 18px;
  height: 18px;
  margin: 5px 0 0;
  flex: none;
  accent-color: var(--au-gold-text);
  cursor: pointer;
}

/* buttons */
.au-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: var(--au-ink);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}
.au-btn:hover { background: var(--au-ink-deep); color: #fff; }
.au-btn .au-btn__gold { color: var(--au-gold); }
.au-btn--line { background: transparent; border-color: var(--au-ink); color: var(--au-ink); }
.au-btn--line:hover { background: var(--au-ink); color: #fff; }
.au-btn[disabled] { opacity: 0.7; cursor: progress; }
.au-btn-row { display: grid; gap: 12px; margin-top: 4px; }

.au-linkbtn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--au-gold-text);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(138, 98, 55, 0.35);
  text-underline-offset: 0.45em;
  cursor: pointer;
}
.au-linkbtn:hover { color: #6e4d2a; text-decoration-color: currentColor; }

.au-alt {
  margin-top: 28px !important;
  padding-top: 24px;
  border-top: 1px solid var(--au-line);
  text-align: center;
  color: var(--au-muted);
}
.au-alt a {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(138, 98, 55, 0.35);
  text-underline-offset: 0.45em;
}
.au-alt a:hover { color: #6e4d2a; text-decoration-color: currentColor; }

.au-captcha { min-height: 78px; }

[hidden] { display: none !important; }

/* ------------------------------------------------------------------ motion */
@media (prefers-reduced-motion: no-preference) {
  .au-input,
  .au-btn,
  .au-eye,
  .au-body a {
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease,
      color 0.18s ease, text-decoration-color 0.18s ease;
  }
}

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .au-panel { padding: 36px 36px 28px; }
}

@media (max-width: 899.98px) {
  .au { grid-template-columns: minmax(0, 1fr); }
  .au-panel {
    position: relative;
    height: auto;
    padding: 24px 20px 28px;
  }
  .au-panel::after {
    top: auto;
    right: 0;
    width: auto;
    height: 6px;
    border-left: 0;
    border-right: 0;
    border-top: 1px solid rgba(201, 169, 97, 0.45);
    border-bottom: 2px solid var(--au-gold-deco);
  }
  .au-panel__rosette { width: 520px; height: 520px; left: -220px; top: -220px; }
  .au-panel__body { margin-top: 28px; }
  .au-panel__title { font-size: 1.45rem; margin-top: 10px !important; }
  .au-panel__lead,
  .au-sheet,
  .au-panel__foot { display: none; }
  .au-main { padding: 40px 20px 24px; justify-content: flex-start; }
  .au-head { margin-bottom: 26px; }
}
