/* ============================================================
   binzakzouk — نظام التصميم
   الألوان مستخرجة من لوجو دكان الآفاق
   ============================================================ */

:root {
  /* الهوية */
  --orange:      #F47E3C;
  --orange-lite: #F79D3E;
  --orange-soft: #FDEDE2;
  --blue:        #2C7DC1;
  --blue-deep:   #1573BB;
  --blue-soft:   #E7F1FA;

  --grad-orange: linear-gradient(135deg, #F4763B 0%, #F79D3E 100%);
  --grad-blue:   linear-gradient(135deg, #1573BB 0%, #2C7DC1 100%);
  --grad-brand:  linear-gradient(120deg, #F4763B 0%, #F79D3E 42%, #2C7DC1 100%);

  /* المحايدات */
  --ink:        #12212F;
  --ink-2:      #3D4A5C;
  --muted:      #6B7A90;
  --line:       #E2E8F0;
  --surface:    #FFFFFF;
  --bg:         #F4F6F9;

  --ok:    #1E9E6A;
  --warn:  #D98324;
  --danger:#D64545;

  --r-sm: 8px;
  --r:    14px;
  --r-lg: 20px;

  --shadow-sm: 0 1px 2px rgba(18,33,47,.06);
  --shadow:    0 6px 20px rgba(18,33,47,.08);
  --shadow-lg: 0 18px 48px rgba(18,33,47,.14);

  --font: "Tajawal", "Segoe UI", Tahoma, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.6;
}

/* ============================ الدخول ============================ */

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 18px;
  position: relative;
  overflow: hidden;
}

/* شكل مستوحى من زوايا اللوجو السداسية */
.auth-wrap::before,
.auth-wrap::after {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 42%;
  filter: blur(10px);
  opacity: .10;
  pointer-events: none;
}
.auth-wrap::before { background: var(--grad-orange); top: -230px;  inset-inline-start: -180px; }
.auth-wrap::after  { background: var(--grad-blue);   bottom: -260px; inset-inline-end: -200px; }

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 34px 30px 30px;
  border-top: 5px solid transparent;
  background-image: linear-gradient(var(--surface), var(--surface)), var(--grad-brand);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

.brand {
  text-align: center;
  margin-bottom: 26px;
}

.brand__mark {
  width: 76px;
  height: auto;
  margin: 0 auto 12px;
  display: block;
}

.brand__name {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: .3px;
  margin: 0;
  color: var(--ink);
}

.brand__sub {
  font-size: 12.5px;
  color: var(--muted);
  margin: 3px 0 0;
}

/* ============================ النماذج ============================ */

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 7px;
}

.input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #FBFCFD;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
}

.input:focus {
  border-color: var(--blue);
  background: var(--surface);
  box-shadow: 0 0 0 3.5px rgba(44,125,193,.14);
}

.input::placeholder { color: #A8B3C1; }

/* خانة الرمز */
.otp-input {
  height: 62px;
  font-size: 30px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 14px;
  padding-inline-start: 14px;
  direction: ltr;
  font-variant-numeric: tabular-nums;
}

.btn {
  width: 100%;
  height: 47px;
  border: 0;
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 700;
  color: #fff;
  background: var(--grad-blue);
  cursor: pointer;
  transition: transform .12s, box-shadow .16s, opacity .16s;
  box-shadow: 0 4px 12px rgba(21,115,187,.26);
}

.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 7px 18px rgba(21,115,187,.32); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }

.btn--orange { background: var(--grad-orange); box-shadow: 0 4px 12px rgba(244,126,60,.28); }
.btn--orange:hover:not(:disabled) { box-shadow: 0 7px 18px rgba(244,126,60,.34); }

.btn--ghost {
  background: transparent;
  color: var(--blue-deep);
  box-shadow: none;
  border: 1.5px solid var(--line);
  font-weight: 600;
}
.btn--ghost:hover:not(:disabled) { background: var(--blue-soft); border-color: var(--blue); transform: none; box-shadow: none; }

.link-btn {
  background: none;
  border: 0;
  padding: 4px 2px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--blue-deep);
  cursor: pointer;
  text-decoration: none;
}
.link-btn:hover { color: var(--orange); }
.link-btn:disabled { color: var(--muted); cursor: default; }

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* مربع التذكّر */
.check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  background: var(--blue-soft);
  border-radius: var(--r-sm);
  padding: 12px 13px;
  margin-top: 4px;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: border-color .16s;
}
.check:hover { border-color: #C5DDF1; }

.check input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--blue);
  flex: none;
  cursor: pointer;
}

.check__text { font-size: 13px; color: var(--ink-2); }
.check__text b { display: block; font-size: 13.5px; color: var(--ink); margin-bottom: 1px; }

/* ============================ التنبيهات ============================ */

.alert {
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-size: 13.5px;
  margin-bottom: 16px;
  border-inline-start: 4px solid;
  display: none;
}
.alert.show { display: block; }

.alert--error { background: #FDEDED; border-color: var(--danger); color: #8E2F2F; }
.alert--ok    { background: #E9F7F1; border-color: var(--ok);     color: #14654A; }
.alert--info  { background: var(--orange-soft); border-color: var(--orange); color: #8A4A1D; }

.hint {
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
  margin: 14px 0 0;
}

.sent-to {
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-2);
  margin: 0 0 18px;
}
.sent-to b { color: var(--ink); direction: ltr; display: inline-block; unicode-bidi: embed; }

.countdown {
  font-variant-numeric: tabular-nums;
  color: var(--orange);
  font-weight: 700;
}

/* ============================ عام ============================ */

.step { display: none; }
.step.active { display: block; animation: rise .22s ease-out; }

@keyframes rise {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: none; }
}

.spinner {
  width: 17px;
  height: 17px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  display: inline-block;
  vertical-align: -3px;
  margin-inline-end: 7px;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.codes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin: 16px 0;
}

.codes-grid code {
  background: var(--bg);
  border: 1.5px dashed var(--line);
  border-radius: var(--r-sm);
  padding: 10px;
  text-align: center;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 1px;
  direction: ltr;
  color: var(--ink);
}

@media (max-width: 420px) {
  .auth-card { padding: 28px 20px 24px; }
  .otp-input { font-size: 25px; letter-spacing: 10px; }
}
