/* ───────────────────────── صفحات الدخول والتسجيل ───────────────────────── */

.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

/* ── Desk: the form side (right in RTL) ── */
.desk {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 28px;
  background: var(--paper);
}

.desk-inner { width: 100%; max-width: 400px; animation: rise .4s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.desk-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  margin-bottom: 40px;
}
.desk-brand .emblem { width: 36px; height: 36px; padding: 7px; border-radius: 9px; background: var(--accent); color: #fff; }

.eyebrow {
  display: inline-block;
  margin: 0 0 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 500;
}

.desk-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 32px;
  line-height: 1.3;
  letter-spacing: -.02em;
}
.lede { margin: 8px 0 28px; color: var(--ink-2); font-size: 15px; }

.ledger-form { display: grid; gap: 16px; }

.field label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  border: 1px solid var(--rule);
  background: var(--card);
  padding: 11px 14px;
  font-size: 16px;
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-1);
  transition: border-color .15s, box-shadow .15s;
}
.field input[dir="ltr"] { text-align: right; }
.field input::placeholder { color: var(--ink-3); }
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field.invalid input { border-color: var(--danger); }
.field-error { margin: 6px 0 0; font-size: 13px; color: var(--danger); min-height: 0; }
.field-error:empty { display: none; }

.pw-wrap { position: relative; }
.pw-wrap input { padding-inline-end: 48px; }
.pw-toggle {
  position: absolute;
  inset-inline-end: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  display: grid; place-items: center;
  color: var(--ink-3);
  border-radius: 6px;
}
.pw-toggle:hover { color: var(--ink); background: var(--paper-2); }
.pw-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.pw-toggle .slash { opacity: 1; transition: opacity .2s; }
.pw-toggle[aria-pressed="true"] .slash { opacity: 0; }

.form-alert {
  padding: 12px 14px;
  border-radius: var(--radius-m);
  background: color-mix(in srgb, var(--danger) 6%, var(--card));
  border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent);
  animation: rise .25s var(--ease);
  color: var(--ink);
  font-size: 14.5px;
}

.btn-seal {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  margin-top: 6px;
  padding: 0 20px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 15.5px;
  text-decoration: none;
  border-radius: var(--radius-m);
  transition: background-color .15s, transform .15s;
}
.btn-seal:hover { background: var(--accent-2); }
.btn-seal:active { transform: scale(.98); }
.btn-seal.busy .btn-label { display: none; }
.btn-seal.busy .btn-busy { display: inline-flex; }
.btn-seal:disabled { cursor: progress; }

.switch { margin: 24px 0 0; color: var(--ink-2); font-size: 14.5px; text-align: center; }
.switch a { font-weight: 600; text-decoration: none; }
.switch a:hover { text-decoration: underline; }

.desk-note {
  margin: 36px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.8;
}

/* ── Folio: the brand panel (left in RTL) — flat accent blue ── */
.folio {
  position: relative;
  padding: 16px;
  background: var(--paper);
}

.folio-frame {
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  background: var(--accent);
  color: #fff;
  padding: 36px 44px;
}

.folio-top {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
}
.seal-emblem { width: 36px; height: 36px; padding: 7px; border-radius: 9px; background: #fff; color: var(--accent); }

.folio-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 480px;
  padding: 32px 0;
}

.folio-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 44px;
  line-height: 1.3;
  letter-spacing: -.02em;
}
.folio-tag { margin: 14px 0 0; font-size: 16.5px; line-height: 1.8; color: rgba(255, 255, 255, .82); }

.articles {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.articles li { display: flex; gap: 12px; align-items: flex-start; }
.articles svg {
  width: 24px; height: 24px; flex: none;
  padding: 4px;
  margin-top: 2px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
}
.articles span { font-size: 15px; color: rgba(255, 255, 255, .92); line-height: 1.8; }

.folio-foot {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: rgba(255, 255, 255, .7);
}

/* ── 404 ── */
.lost-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.lost { text-align: center; max-width: 420px; }
.lost .emblem { width: 52px; height: 52px; margin: 0 auto 18px; padding: 10px; border-radius: 12px; background: var(--accent); color: #fff; }
.lost h1 { font-family: var(--font-display); font-size: 32px; margin: 0 0 8px; }
.lost p { color: var(--ink-2); }
.lost .btn-seal { margin-top: 18px; width: auto; }

/* ── Responsive ── */
@media (max-width: 960px) {
  .auth-page { grid-template-columns: 1fr; }
  .folio { display: none; }
  .desk { padding: max(32px, env(safe-area-inset-top)) 20px max(40px, env(safe-area-inset-bottom)); align-items: flex-start; }
  .desk-brand { margin-bottom: 32px; }
  .desk-head h1 { font-size: 28px; }
}
