/* مركز الرسائل — الصفحات العامّة (AYUN-MSG SA 1.1.0): استعادة كلمة المرور برمز (/password/sms…) داخل تخطيط الدخول auth-modern،
   وصفحات الروابط القصيرة (/s/<رمز>). رموز صفحة الدخول نفسها من ayun-auth.css (--accent، --text-*، --field-*، --glass-*، --success، --error)
   في الوضعين الفاتح والداكن، ولون التمييز من قالب العلامة البيضاء (لا لون علامةٍ صريح). زوايا المالك 4/6/8 لكل ما ترسمه هذه الصفحات، ولا كبسولات؛
   الدائرة للّمبات وحدها. حركة واحدة: تقدّم العدّاد التنازلي لإعادة الإرسال — تُطفأ مع prefers-reduced-motion. */

/* ── نطاق صفحات الاستعادة داخل بطاقة الدخول ─────────────────────────────────────────────────── */
.amp { --amp-r1: 4px; --amp-r2: 6px; --amp-r3: 8px; --amp-ink: var(--accent-ink, var(--accent)); }
.amp .field-input, .amp .btn, .amp .alert, .amp .field-trail-btn { border-radius: var(--amp-r2); }
.amp .btn-primary::after { display: none; }
.amp .form-subtitle { margin-bottom: 22px; }
.amp .alert { align-items: center; }
.amp :is(a, button, input, label):focus-visible { outline: 2px solid var(--amp-ink); outline-offset: 2px; }
.amp .field-input:focus-visible { outline: 0; }
.amp-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.amp-ltr { direction: ltr; unicode-bidi: isolate; font-family: var(--font-mono, monospace); letter-spacing: 0; }

/* المراحل: ثلاث خطوات حقيقية (الحساب ← الرمز ← كلمة المرور) */
.amp-steps { list-style: none; margin: 0 0 22px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; counter-reset: none; }
.amp-steps li { position: relative; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.amp-steps li::before { content: ''; block-size: 3px; border-radius: 2px; background: var(--field-border-hover); }
.amp-steps li.done::before, .amp-steps li.now::before { background: var(--accent); }
.amp-steps .s { display: flex; align-items: center; gap: 8px; min-width: 0; }
.amp-steps .n { inline-size: 22px; block-size: 22px; flex: none; display: grid; place-items: center; border-radius: var(--amp-r2); font-family: var(--font-mono, monospace); font-size: 11px; font-weight: 600;
  color: var(--text-secondary); background: var(--field-bg); box-shadow: inset 0 0 0 1px var(--field-border-hover); }
.amp-steps li.now .n { background: var(--accent); color: var(--accent-on-bg); box-shadow: none; }
.amp-steps li.done .n { background: var(--accent-soft); color: var(--amp-ink); box-shadow: none; }
.amp-steps .n svg { inline-size: 12px; block-size: 12px; }
.amp-steps .t { font-size: 12px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.amp-steps li.now .t { color: var(--text-primary); }

/* الوسيلة: بطاقات اختيار (راديو حقيقي داخل كل بطاقة) */
.amp-choices { display: grid; gap: 10px; margin-bottom: 20px; border: 0; padding: 0; min-width: 0; }
.amp-choice { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr) 20px; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--amp-r2); cursor: pointer;
  background: var(--field-bg); box-shadow: inset 0 0 0 1px var(--field-border); transition: box-shadow .2s var(--ease-out), background .2s var(--ease-out); color: var(--text-primary); }
.amp-choice:hover { box-shadow: inset 0 0 0 1px var(--field-border-hover); }
.amp-choice input { position: absolute; opacity: 0; inline-size: 1px; block-size: 1px; margin: 0; }
.amp-choice .ic { inline-size: 40px; block-size: 40px; border-radius: var(--amp-r2); display: grid; place-items: center; background: var(--accent-soft); color: var(--amp-ink); }
.amp-choice .ic svg { inline-size: 20px; block-size: 20px; }
.amp-choice .tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.amp-choice .tx b { font-size: 14px; font-weight: 700; }
.amp-choice .tx .amp-ltr { font-size: 13px; color: var(--text-secondary); text-align: start; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amp-choice .ck { inline-size: 20px; block-size: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--field-border-hover); display: grid; place-items: center; }
.amp-choice:has(input:checked) { background: var(--field-bg-focus, var(--field-bg)); box-shadow: inset 0 0 0 2px var(--accent); }
.amp-choice:has(input:checked) .ck { background: var(--accent); box-shadow: none; }
.amp-choice:has(input:checked) .ck::after { content: ''; inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--accent-on-bg); }
.amp-choice:has(input:focus-visible) { outline: 2px solid var(--amp-ink); outline-offset: 2px; }

/* الوجهة المقنَّعة في جملة عربية: معزولةٌ بترتيبها الصحيح */
.amp-dest { display: inline-block; direction: ltr; unicode-bidi: isolate; font-family: var(--font-mono, monospace); font-size: .92em; font-weight: 600; color: var(--text-primary);
  padding: 0 6px; border-radius: var(--amp-r1); background: var(--accent-soft); white-space: nowrap; }

/* خانات الرمز */
.amp-otp { display: flex; gap: 8px; direction: ltr; justify-content: space-between; margin: 4px 0 2px; }
.amp-otp input { flex: 1 1 0; min-width: 0; block-size: 58px; text-align: center; font-family: var(--font-mono, monospace); font-size: 24px; font-weight: 600; color: var(--text-primary);
  background: var(--field-bg); border: 1px solid var(--field-border); border-radius: var(--amp-r2); outline: none; caret-color: var(--accent); transition: border-color .2s var(--ease-out), box-shadow .2s var(--ease-out), background .2s; }
.amp-otp input:hover { border-color: var(--field-border-hover); }
.amp-otp input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--field-bg-focus, var(--field-bg)); }
.amp-otp input.has { border-color: color-mix(in srgb, var(--accent) 55%, var(--field-border)); }
.amp-resend { display: flex; flex-direction: column; gap: 8px; margin: 16px 0 6px; }
.amp-resend .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--text-secondary); }
.amp-resend form { margin: 0; }
.amp-resend button { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--amp-ink); cursor: pointer; }
.amp-resend button[disabled] { color: var(--text-secondary); font-weight: 500; cursor: default; }
.amp-resend .bar { block-size: 3px; border-radius: 2px; background: var(--field-border); overflow: hidden; }
.amp-resend .bar i { display: block; block-size: 100%; background: var(--accent); inline-size: var(--p, 0%); transition: inline-size 1s linear; }
.amp-resend .bar[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .amp-resend .bar i { transition: none; } }

/* كلمة المرور الجديدة: الشروط حيّة من إعداد المنصّة (settings.password) — إرشادٌ فقط، الخادم يقرّر */
.amp-rules { margin: -6px 0 18px; padding: 12px 14px; border-radius: var(--amp-r2); background: var(--field-bg); box-shadow: inset 0 0 0 1px var(--field-border); }
.amp-rules b { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.amp-rules ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.amp-rules li { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-secondary); }
.amp-rules li i { inline-size: 16px; block-size: 16px; border-radius: var(--amp-r1); flex: none; display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px var(--field-border-hover); }
.amp-rules li.ok { color: var(--text-primary); }
.amp-rules li.ok i { background: var(--success); box-shadow: none; }
.amp-rules li.ok i::after { content: ''; inline-size: 7px; block-size: 4px; border-left: 2px solid var(--bg-base); border-bottom: 2px solid var(--bg-base); transform: rotate(-45deg) translate(1px, -1px); }
.amp-match { display: flex; align-items: center; gap: 8px; margin: -8px 0 16px; font-size: 13px; font-weight: 600; min-block-size: 20px; }
.amp-match i { inline-size: 8px; block-size: 8px; border-radius: 50%; flex: none; }
.amp-match.ok { color: var(--success); } .amp-match.ok i { background: var(--success); }
.amp-match.bad { color: var(--error); } .amp-match.bad i { background: var(--error); }
.amp-match:empty { display: none; }

/* ══ الروابط القصيرة (/s/…): صفحةٌ واحدة بأرضية صفحة الدخول ═══════════════════════════════════════ */
.lk { --lk-r1: 4px; --lk-r2: 6px; --lk-r3: 8px; margin: 0; min-height: 100vh; background: var(--bg-base); color: var(--text-primary); font-family: var(--font-body); font-size: 15px; line-height: 1.6; }
.lk *, .lk *::before, .lk *::after { box-sizing: border-box; }
.lk .bg-layer, .lk .bg-grid { z-index: 0; }
.lk-wrap { position: relative; z-index: 2; min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 22px 16px 36px; gap: 18px; }
.lk-top { inline-size: 100%; max-inline-size: 600px; display: flex; align-items: center; gap: 12px; min-width: 0; }
.lk-mark { inline-size: 44px; block-size: 44px; border-radius: var(--lk-r3); display: grid; place-items: center; overflow: hidden; flex: none; background: var(--glass-bg-strong); box-shadow: inset 0 0 0 1px var(--glass-border), var(--shadow-card); }
.lk-mark img { max-inline-size: 36px; max-block-size: 36px; object-fit: contain; }
.lk-mark .ini { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--accent-ink, var(--accent)); }
.lk-name { display: flex; flex-direction: column; min-width: 0; }
.lk-name strong { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lk-name small { font-size: 12.5px; color: var(--text-secondary); }
.lk-lang { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 7px; min-block-size: 36px; padding: 0 12px; border-radius: var(--lk-r2); font-size: 13px; font-weight: 600; text-decoration: none;
  color: var(--text-secondary); background: var(--glass-bg-strong); box-shadow: inset 0 0 0 1px var(--glass-border); }
.lk-lang:hover { color: var(--text-primary); }
.lk-lang svg, .lk svg.i { inline-size: 16px; block-size: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lk-card { inline-size: 100%; max-inline-size: 600px; border-radius: var(--lk-r3); overflow: hidden; background: var(--glass-bg-strong); box-shadow: inset 0 0 0 1px var(--glass-border), var(--shadow-card); }
.lk-map { position: relative; block-size: 280px; background: var(--field-bg); border-block-end: 1px solid var(--field-border); }
.lk-map #map { position: absolute; inset: 0; }
.lk-body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 14px; }
.lk-kick { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 700; color: var(--accent-ink, var(--accent)); }
.lk-kick .led { inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--error); box-shadow: 0 0 0 4px color-mix(in srgb, var(--error) 22%, transparent); flex: none; }
.lk h1 { margin: 0; font-family: var(--font-display); font-size: 26px; font-weight: 700; line-height: 1.35; color: var(--text-primary); }
[lang="ar"] .lk h1 { font-weight: 800; line-height: 1.6; }
.lk-lead { margin: 0; color: var(--text-secondary); line-height: 1.8; font-size: 15px; }
.lk-facts { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; border-radius: var(--lk-r2); overflow: hidden; box-shadow: 0 0 0 1px var(--field-border); }
.lk-facts > div { padding: 11px 14px; min-width: 0; box-shadow: 0 0 0 1px var(--field-border); }
.lk-facts > div.wide { grid-column: 1 / -1; }
.lk-facts dt { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
.lk-facts dd { margin: 3px 0 0; font-size: 16px; font-weight: 700; color: var(--text-primary); overflow-wrap: anywhere; line-height: 1.6; }
.lk-facts dd.ltr { direction: ltr; unicode-bidi: isolate; text-align: start; font-family: var(--font-mono, monospace); font-size: 15px; font-weight: 600; }
.lk-acts { display: flex; gap: 10px; flex-wrap: wrap; }
.lk-btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-block-size: 48px; padding: 0 20px; border-radius: var(--lk-r2); font-weight: 700; font-size: 15px; text-decoration: none; flex: 1 1 auto;
  color: var(--text-primary); background: var(--field-bg); box-shadow: inset 0 0 0 1px var(--field-border-hover); transition: background .2s var(--ease-out); }
.lk-btn.pri { background: var(--accent); color: var(--accent-on-bg); box-shadow: var(--shadow-btn); }
.lk-btn:hover { filter: brightness(1.05); }
.lk-btn:focus-visible, .lk-lang:focus-visible, .lk-foot a:focus-visible { outline: 2px solid var(--accent-ink, var(--accent)); outline-offset: 3px; }
.lk-gone { align-items: flex-start; }
.lk-wrap:has(.lk-gone) { justify-content: center; }
.lk-wrap:has(.lk-gone) .lk-foot { display: none; }
.lk-ic { inline-size: 52px; block-size: 52px; border-radius: var(--lk-r3); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink, var(--accent)); }
.lk-ic svg.i { inline-size: 26px; block-size: 26px; }
.lk-foot { font-size: 13px; color: var(--text-secondary); text-align: center; }
.lk-foot a { color: var(--accent-ink, var(--accent)); font-weight: 600; }
@media (max-width: 520px) {
  .lk-wrap { padding: 14px 12px 28px; gap: 14px; }
  .lk-map { block-size: 220px; }
  .lk-body { padding: 18px 16px 20px; }
  .lk h1 { font-size: 22px; }
  .lk-facts { grid-template-columns: minmax(0, 1fr); }
}
