/* PAYUNIT — signed-out screens.
 *
 * Loaded on top of pu-base.css. Deliberately small: these pages are opened once,
 * often on a slow connection and sometimes on a borrowed device.
 *
 * Everything here uses logical properties so one stylesheet serves Arabic and
 * English, with two exceptions that are called out where they appear: the
 * phone-prefix affix and the code field, whose contents are always dir="ltr".
 */

.auth-body{
  min-height:100dvh;
  display:grid;
  grid-template-rows:auto 1fr auto;
  background:
    radial-gradient(1100px 520px at 50% -180px,rgba(195,154,78,.14),rgba(195,154,78,0) 62%),
    var(--page);
}

/* ---------- Bar ---------------------------------------------------------- */
.auth-bar{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:14px clamp(14px,4vw,28px);
  max-width:1180px;width:100%;margin-inline:auto;min-width:0;
}
.auth-brand{display:inline-flex;align-items:center;gap:10px;color:var(--ink);min-width:0}
.auth-brand .pu-wordmark{font-size:22px;font-weight:700;line-height:1.35}
/* ---------- Main --------------------------------------------------------- */
.auth-main{
  width:100%;max-width:500px;margin-inline:auto;
  padding:8px clamp(14px,4vw,24px) 32px;
  display:grid;gap:14px;align-content:start;
  grid-template-columns:minmax(0,1fr);
}
/* Registration and recovery carry a real form, not a single field. */
.auth-main.is-wide{max-width:720px}
/* ---------- Card --------------------------------------------------------- */
.auth-card{
  position:relative;background:var(--paper);border:1px solid var(--line);border-radius:var(--r-lg);
  padding:clamp(20px,5vw,30px);box-shadow:var(--shadow);
  display:grid;gap:18px;min-width:0;grid-template-columns:minmax(0,1fr);
}
/* Back is navigation, not content. Keep it out of the grid so it never creates an
   empty row above the icon/title. It lives on the opposite corner from the page icon. */
.auth-card-nav{position:absolute;z-index:3;inset-block-start:16px;inset-inline-end:16px;width:30px;height:30px;display:block;min-width:0}
.auth-card-back{display:grid;place-items:center;width:30px;height:30px;border-radius:999px;background:transparent;color:var(--ink-soft);transition:background .2s,color .2s}
.auth-card-back svg{width:19px;height:19px}.auth-card-back:hover,.auth-card-back:focus-visible{background:var(--page-2);color:var(--ink)}

.auth-head{display:grid;gap:7px;min-width:0}
.auth-head h1{font-size:clamp(21px,5.2vw,25px);font-weight:700;letter-spacing:-.02em;line-height:1.25}
.auth-head p{font-size:13.5px;color:var(--muted);line-height:1.7;text-wrap:pretty;overflow-wrap:anywhere}
.auth-head p bdi{font-weight:600;color:var(--ink)}
.auth-eyebrow{font-size:11.5px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--gold-deep)}

.auth-ic{
  width:46px;height:46px;border-radius:15px;display:grid;place-items:center;
  background:var(--gold-soft);border:1px solid var(--gold-line);color:var(--gold-deep);
}
.auth-ic svg{width:21px;height:21px}

/* ---------- Form -------------------------------------------------------- */
.auth-form{display:grid;gap:15px;min-width:0;grid-template-columns:minmax(0,1fr)}
.auth-grid{display:grid;gap:15px;grid-template-columns:minmax(0,1fr)}
@media(min-width:560px){
  .auth-grid.is-two{grid-template-columns:repeat(2,minmax(0,1fr))}
  .auth-grid .is-wide{grid-column:1/-1}
}

/* An input with a leading glyph. The glyph is positioned with logical
   properties so it follows the reading direction, and the input reserves room
   for it on the same side. */
/* These two wrappers are direct <span> children of .pu-field, and
   `.pu-field>span` in pu-base.css is (0,1,1) — it beats a bare class and would
   turn both of them into label text with a bottom margin. Match that
   specificity so the wrapper stays a wrapper. */
.pu-field>span.auth-input{position:relative;display:block;min-width:0;margin-block-end:0;font-size:inherit;font-weight:inherit;color:inherit}
.auth-input{position:relative;display:block;min-width:0}
.auth-input>svg{
  position:absolute;inset-block-start:50%;inset-inline-start:13px;transform:translateY(-50%);
  width:17px;height:17px;color:var(--faint);pointer-events:none;
}
.auth-input .pu-input{padding-inline-start:40px}
.auth-input select.pu-input{padding-inline-start:40px}

/* The phone affix and its field are BOTH dir="ltr", so the prefix must sit on
   the physical left in either language — a logical property would put "+970"
   on the right of digits that start on the left. */
.pu-field>span.auth-phone,.auth-phone{
  position:relative;display:flex;align-items:stretch;min-width:0;
  margin-block-end:0;font-size:inherit;font-weight:inherit;color:inherit;
}
.auth-phone-prefix{
  display:inline-flex;align-items:center;gap:2px;flex:0 0 auto;
  padding:0 12px;border:1.5px solid var(--line);border-right:0;
  border-radius:var(--r-sm) 0 0 var(--r-sm);
  background:var(--page-2);color:var(--ink-soft);
  font-family:var(--mono);font-size:13.5px;font-weight:600;
}
.auth-phone .pu-input{border-radius:0 var(--r-sm) var(--r-sm) 0;min-width:0;flex:1}
html[dir="rtl"] .auth-phone{direction:ltr}
html[dir="rtl"] .auth-phone .pu-input{text-align:left}

/* One-time code. Wide tracking makes six digits readable at a glance and makes
   a transposed digit visible before it is submitted. */
.auth-code .pu-input{
  height:60px;font-family:var(--mono);font-size:26px;font-weight:700;
  letter-spacing:.42em;text-indent:.42em;text-align:center;
  font-variant-numeric:tabular-nums;
}
@media(max-width:360px){.auth-code .pu-input{height:54px;font-size:22px;letter-spacing:.3em;text-indent:.3em}}

/* ---------- Choice tiles ------------------------------------------------- */
.auth-fieldset{border:0;padding:0;margin:0;min-inline-size:0;display:grid;gap:9px}
.auth-fieldset legend{font-size:12.5px;font-weight:600;color:var(--ink-soft);padding:0;margin-block-end:2px}
.auth-choices{display:grid;gap:10px;grid-template-columns:minmax(0,1fr)}
@media(min-width:460px){.auth-choices{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* بعد حذف وصف نوع الحساب صار السطر سطرًا واحدًا، فمحاذاة flex-start كانت
   تترك الأيقونة وعلامة الاختيار أعلى النص. المحاذاة للوسط هي الصحيحة الآن. */
.auth-choice{
  position:relative;display:flex;align-items:center;gap:11px;
  padding:13px;border-radius:var(--r-md);border:1.5px solid var(--line);
  background:var(--paper);cursor:pointer;min-width:0;
  transition:border-color .16s,background .16s,box-shadow .16s;
}
.auth-choice:hover{border-color:#d3d7e0}
.auth-choice input{position:absolute;opacity:0;width:1px;height:1px}
.auth-choice:focus-within{border-color:var(--ink);box-shadow:0 0 0 3px rgba(13,21,38,.08)}
.auth-choice:has(input:checked){border-color:var(--ink);background:#fbfbfd}
.auth-choice-ic{
  width:34px;height:34px;border-radius:11px;flex:0 0 auto;display:grid;place-items:center;
  background:var(--page-2);color:var(--ink-soft);transition:background .16s,color .16s;
}
.auth-choice-ic svg{width:16px;height:16px}
.auth-choice:has(input:checked) .auth-choice-ic{background:var(--ink);color:#fff}
.auth-choice-copy{min-width:0;flex:1}
.auth-choice-copy b{display:block;font-size:14px;font-weight:600;overflow-wrap:anywhere}
.auth-choice-copy small{display:block;font-size:12.5px;color:var(--muted);line-height:1.55;margin-block-start:2px;overflow-wrap:anywhere}
.auth-choice-tick{flex:0 0 auto;color:var(--ok);opacity:0;transition:opacity .16s}
.auth-choice-tick svg{width:17px;height:17px;stroke-width:2.6}
.auth-choice:has(input:checked) .auth-choice-tick{opacity:1}

/* ---------- Secondary actions -------------------------------------------- */
.auth-actions{display:grid;gap:9px;grid-template-columns:minmax(0,1fr)}
@media(min-width:420px){.auth-actions.is-two{grid-template-columns:repeat(2,minmax(0,1fr))}}
.auth-actions .pu-btn,.auth-actions form,.auth-actions form .pu-btn{width:100%}

.auth-link{
  display:block;text-align:center;font-size:13.5px;font-weight:600;
  color:var(--ink-soft);padding:4px;transition:color .16s;overflow-wrap:anywhere;
}
.auth-link:hover{color:var(--ink);text-decoration:underline;text-underline-offset:3px}

.auth-rule{display:flex;align-items:center;gap:12px;color:var(--faint);font-size:12px}
.auth-rule::before,.auth-rule::after{content:"";flex:1;height:1px;background:var(--line)}

.auth-alt{font-size:13.5px;color:var(--muted);text-align:center;overflow-wrap:anywhere}
.auth-alt a{font-weight:600;color:var(--ink);text-decoration:underline;text-underline-offset:3px}

/* ---------- Countdown ---------------------------------------------------- */
.auth-timer{
  font-size:12.5px;color:var(--muted);text-align:center;
  font-variant-numeric:tabular-nums;overflow-wrap:anywhere;
}
.auth-timer.is-expired{color:var(--bad);font-weight:600}

/* ---------- Facts list (passkey setup) ----------------------------------- */
.auth-facts{display:grid;gap:1px;border-radius:var(--r-md);overflow:hidden;border:1px solid var(--line);background:var(--line-soft)}
.auth-facts>div{display:flex;align-items:center;gap:11px;padding:12px 13px;background:var(--paper);min-width:0}
.auth-facts svg{width:17px;height:17px;color:var(--faint);flex:0 0 auto}
.auth-facts>div>span{min-width:0}
.auth-facts b{display:block;font-size:11.5px;font-weight:600;color:var(--muted)}
.auth-facts strong{display:block;font-size:13.5px;font-weight:600;margin-block-start:2px;overflow-wrap:anywhere}
.auth-facts small{display:block;font-size:12.5px;color:var(--muted);line-height:1.55;margin-block-start:2px;overflow-wrap:anywhere}

/* ---------- Disclosure --------------------------------------------------- */
.auth-details{border:1px solid var(--line);border-radius:var(--r-md);background:var(--page-2);min-width:0}
.auth-details summary{
  padding:13px 14px;cursor:pointer;font-size:13.5px;font-weight:600;color:var(--ink-soft);
  list-style:none;display:flex;align-items:center;justify-content:space-between;gap:10px;
}
.auth-details summary::-webkit-details-marker{display:none}
.auth-details summary::after{content:"+";font-size:17px;font-weight:600;color:var(--faint);flex:0 0 auto}
.auth-details[open] summary::after{content:"−"}
.auth-details summary:hover{color:var(--ink)}
.auth-details-body{padding:0 14px 14px;display:grid;gap:13px;min-width:0;grid-template-columns:minmax(0,1fr)}
.auth-details-body p{font-size:13px;color:var(--muted);line-height:1.7}

/* ---------- Narrow-screen and wide-screen hardening ---------------------- */
.auth-main>*,.auth-card>*,.auth-form>*,.auth-grid>*{min-width:0}
@media(max-width:340px){
  .auth-card{padding:16px;gap:15px}
  .auth-phone-prefix{padding:0 9px;font-size:12.5px}
}
@media(min-width:1600px){
  .auth-main{padding-block-start:24px}
}

/* An input whose contents are always Latin carries dir="ltr", so its text
   starts on the physical LEFT even in Arabic. A logical inset would put the
   glyph on the right and leave a wide gap before the value; pin those to the
   physical left instead, exactly as the amount field does in the console. */
html[dir="rtl"] .auth-input:has(.pu-input[dir="ltr"])>svg{inset-inline-start:auto;left:13px;right:auto}
html[dir="rtl"] .auth-input .pu-input[dir="ltr"]{padding-inline-start:13px;padding-left:40px}

/* ---------- Login choice ------------------------------------------------- */
.auth-login-card{gap:16px}
.auth-login-head{padding-block-end:2px}
.auth-passkey-entry{gap:10px}
.pu-btn-passkey{
  background:var(--paper);color:var(--ink);border:1.5px solid var(--line);
  box-shadow:0 1px 2px rgba(15,23,42,.04);font-weight:700;
}
.pu-btn-passkey:hover,.pu-btn-passkey:focus-visible{border-color:var(--gold-line);background:var(--gold-soft);color:var(--ink)}
.pu-btn-passkey svg{color:var(--gold-deep)}
.auth-rule{display:flex;align-items:center;gap:12px;color:var(--faint);font-size:12px;line-height:1.4;text-align:center}
.auth-rule::before,.auth-rule::after{content:"";height:1px;background:var(--line);flex:1 1 auto;min-width:20px}
.auth-rule>span{flex:0 1 auto;padding-inline:3px}
.pu-field>span.auth-label-row,.auth-label-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-block-end:7px}
.auth-label-row>a{font-size:12px;font-weight:700;color:var(--gold-deep);white-space:nowrap}
.auth-password-input .pu-input{padding-inline-end:44px}
.auth-password-toggle{position:absolute;inset-block-start:50%;inset-inline-end:8px;transform:translateY(-50%);display:grid;place-items:center;width:34px;height:34px;border:0;border-radius:9px;background:transparent;color:var(--faint);cursor:pointer}
.auth-password-toggle:hover,.auth-password-toggle:focus-visible{background:var(--page-2);color:var(--ink)}
.auth-password-toggle svg{position:static;transform:none;width:18px;height:18px;color:currentColor;pointer-events:none}

@media(max-width:420px){.auth-label-row{align-items:flex-start}.auth-login-card{padding:20px 18px}.auth-rule>span{max-width:76%}}
