/* Sannaly Subscriptions — standalone styles (matches site palette) */
:root {
  --primary-dark:  #2C1810;
  --primary-brown: #4A2419;
  --accent-copper: #B8743D;
  --bg-cream:      #F5EBE0;
  --text-on-dark:  #F5D9B8;
  --soft-brown:    #8B5A3C;
  --white:         #FFFFFF;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(44,24,16,.10);
  --shadow-lg: 0 8px 40px rgba(44,24,16,.18);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Cairo', sans-serif;
  background: var(--bg-cream);
  color: var(--primary-dark);
  min-height: 100vh;
}

/* ── Auth card ── */
.auth-body { display: flex; align-items: center; justify-content: center; padding: 24px; min-height: 100vh;
  background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary-brown) 60%, var(--soft-brown) 100%); }
.auth-card { background: var(--white); border-radius: 18px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 430px; padding: 36px 30px; text-align: center; }
.auth-logo img { height: 64px; border-radius: 12px; }
.auth-title { font-size: 1.45rem; font-weight: 800; margin: 14px 0 6px; }
.auth-sub { color: var(--soft-brown); font-size: .95rem; margin-bottom: 22px; line-height: 1.7; }
.field { text-align: right; margin-bottom: 16px; }
.field label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.input {
  width: 100%; padding: 13px 14px; border: 2px solid #e7d9c9; border-radius: var(--radius);
  font: inherit; font-size: 1.05rem; background: #fffdfa; transition: border-color .2s;
}
.input:focus { outline: none; border-color: var(--accent-copper); }
.input.code { text-align: center; letter-spacing: 12px; font-size: 1.6rem; font-weight: 800; direction: ltr; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 13px; border: none; border-radius: var(--radius); cursor: pointer;
  font: inherit; font-weight: 800; font-size: 1.02rem; transition: all .2s;
}
.btn-primary { background: var(--accent-copper); color: var(--white); }
.btn-primary:hover { background: #a4642f; }
.btn-ghost { background: transparent; color: var(--soft-brown); width: auto; padding: 6px 10px; font-size: .9rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.msg { min-height: 22px; font-size: .92rem; font-weight: 700; margin-top: 12px; }
.msg.err { color: #b3261e; }
.msg.ok  { color: #1e7d40; }
.auth-footer { margin-top: 22px; padding-top: 16px; border-top: 1px dashed #e7d9c9; font-size: .88rem; color: var(--soft-brown); line-height: 2; }
.auth-footer a { color: var(--accent-copper); font-weight: 700; text-decoration: none; }
.hint-name { background: var(--bg-cream); border-radius: var(--radius); padding: 10px; font-weight: 700; margin-bottom: 14px; }
.resend-row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: .88rem; }
.register-links { display: grid; gap: 10px; margin-top: 14px; }
.register-links a { display: block; background: var(--bg-cream); border-radius: var(--radius); padding: 12px;
  text-decoration: none; color: var(--primary-dark); font-weight: 700; border: 2px solid transparent; }
.register-links a:hover { border-color: var(--accent-copper); }

/* ── Password auth UI ── */
.pw-wrap { position: relative; }
.pw-wrap .input { padding-left: 48px; }
.pw-toggle {
  position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
  background: transparent; border: none; cursor: pointer; padding: 8px;
  font-size: 1.15rem; line-height: 1; color: var(--soft-brown);
}
.pw-toggle:hover { color: var(--accent-copper); }
.remember-row { display: flex; justify-content: space-between; align-items: center; margin: 2px 0 16px; font-size: .9rem; }
.remember-row label { display: flex; align-items: center; gap: 7px; font-weight: 700; cursor: pointer; user-select: none; }
.remember-row input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--accent-copper); cursor: pointer; }
.forgot-link { color: var(--accent-copper); font-weight: 700; text-decoration: none; font-size: .88rem; background: none; border: none; cursor: pointer; font-family: inherit; padding: 0; }
.forgot-link:hover { text-decoration: underline; }
.switch-auth { margin-top: 18px; padding-top: 16px; border-top: 1px dashed #e7d9c9; font-size: .92rem; color: var(--soft-brown); }
.switch-auth a, .switch-auth button { color: var(--accent-copper); font-weight: 800; text-decoration: none; background: none; border: none; cursor: pointer; font-family: inherit; font-size: inherit; padding: 0; }
.switch-auth a:hover, .switch-auth button:hover { text-decoration: underline; }
.type-pick { display: grid; gap: 10px; margin: 14px 0; }
.type-pick button { display: block; background: var(--bg-cream); border-radius: var(--radius); padding: 13px;
  font: inherit; font-weight: 700; color: var(--primary-dark); border: 2px solid transparent; cursor: pointer; }
.type-pick button:hover, .type-pick button.sel { border-color: var(--accent-copper); }

/* ── Directory / admin layout ── */
.topbar {
  background: var(--primary-dark); color: var(--text-on-dark);
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; position: sticky; top: 0; z-index: 10;
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.topbar .brand img { height: 38px; border-radius: 8px; }
.topbar .user-box { display: flex; align-items: center; gap: 12px; font-size: .9rem; }
.badge { padding: 3px 12px; border-radius: 99px; font-size: .8rem; font-weight: 800; }
.badge.free { background: #6b7280; color: #fff; }
.badge.pro  { background: var(--accent-copper); color: #fff; }
.logout-btn { background: transparent; border: 1px solid var(--text-on-dark); color: var(--text-on-dark);
  border-radius: 8px; padding: 5px 12px; cursor: pointer; font: inherit; font-size: .85rem; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 22px 16px 60px; }

.upgrade-banner {
  background: linear-gradient(135deg, var(--primary-brown), var(--soft-brown));
  color: var(--text-on-dark); border-radius: var(--radius); padding: 18px 20px;
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between;
  margin-bottom: 22px; box-shadow: var(--shadow);
}
.upgrade-banner strong { color: #fff; }
.upgrade-banner .wa-btn {
  background: #25D366; color: #fff; text-decoration: none; font-weight: 800;
  padding: 10px 22px; border-radius: 99px; white-space: nowrap;
}
.pro-banner { background: #eaf7ee; color: #1e7d40; border: 1px solid #bfe5cb;
  border-radius: var(--radius); padding: 12px 18px; font-weight: 700; margin-bottom: 22px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.search { flex: 1; min-width: 220px; }
.count-chip { background: var(--white); border-radius: 99px; padding: 9px 18px; font-weight: 700; box-shadow: var(--shadow); font-size: .9rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card h3 { font-size: 1.05rem; margin-bottom: 4px; }
.card .meta { font-size: .85rem; color: var(--soft-brown); margin-bottom: 10px; }
.card .row { display: flex; gap: 8px; font-size: .9rem; margin: 4px 0; align-items: baseline; }
.card .row .k { color: var(--soft-brown); font-weight: 700; white-space: nowrap; }
.card .desc { font-size: .87rem; color: #5a4636; line-height: 1.6; margin-top: 6px; }
.locked { background: var(--bg-cream); border-radius: 8px; padding: 6px 10px; font-size: .85rem; color: var(--soft-brown); font-weight: 700; }
.phone-link { color: var(--accent-copper); font-weight: 800; text-decoration: none; direction: ltr; unicode-bidi: embed; }
/* sn-tabs-wrap-390: شريط التبويبات في admin.html كان بيعمل تمرير أفقي 158px عند 390 (scrollWidth 536 مقابل 366) فتبويب «البلاغات» بيقع بره الشاشة. flex-wrap بيخلّيهم يلفّوا على سطرين بدل ما يختفوا. */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tab-btn { background: var(--white); border: 2px solid transparent; border-radius: 99px; padding: 8px 20px;
  font: inherit; font-weight: 700; cursor: pointer; box-shadow: var(--shadow); }
.tab-btn.active { border-color: var(--accent-copper); color: var(--accent-copper); }
.empty { text-align: center; color: var(--soft-brown); padding: 50px 0; font-weight: 700; }

/* ── Admin table ── */
.table-wrap { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 11px 13px; text-align: right; border-bottom: 1px solid #f0e6d9; white-space: nowrap; }
/* الشريط العلوي z-index:10 — من غير z-index أعلى منه كان رأس الجدول اللاصق
   بيختفي تحته وإنت بتنزل في جداول الإدارة. */
th { background: var(--bg-cream); font-weight: 800; position: sticky; top: 0; z-index: 11; }
tr:hover td { background: #fdf9f4; }
.mini-btn { border: none; border-radius: 8px; padding: 6px 12px; font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; margin-inline-start: 4px; }
.mini-btn.copper { background: var(--accent-copper); color: #fff; }
.mini-btn.gray { background: #e5e0d8; color: var(--primary-dark); }
.mini-btn.red { background: #fde8e7; color: #b3261e; }
.loading { text-align: center; padding: 60px 0; color: var(--soft-brown); font-weight: 700; }

/* ── Pricing page ── */
.pricing-head { text-align: center; max-width: 720px; margin: 8px auto 30px; }
.pricing-head h1 { font-size: 1.7rem; font-weight: 800; margin-bottom: 12px; }
.pricing-head p { color: var(--soft-brown); line-height: 1.8; font-size: 1rem; }
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; align-items: stretch; }
.plan-card { position: relative; background: var(--white); border-radius: 16px; box-shadow: var(--shadow);
  padding: 28px 22px; text-align: center; display: flex; flex-direction: column;
  border: 2px solid transparent; transition: transform .15s, box-shadow .15s; }
.plan-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.plan-card.featured { border-color: var(--accent-copper); box-shadow: var(--shadow-lg); }
.plan-tag { position: absolute; top: -13px; right: 50%; transform: translateX(50%);
  background: var(--accent-copper); color: #fff; font-size: .78rem; font-weight: 800;
  padding: 5px 16px; border-radius: 99px; white-space: nowrap; }
.plan-icon { font-size: 2.4rem; margin-bottom: 6px; }
.plan-card h3 { font-size: 1.3rem; font-weight: 800; margin-bottom: 8px; }
.plan-price { margin-bottom: 16px; color: var(--primary-dark); }
.plan-price .num { font-size: 2.2rem; font-weight: 800; color: var(--accent-copper); }
.plan-price .cur { font-size: .95rem; color: var(--soft-brown); font-weight: 700; }
.plan-perks { list-style: none; text-align: right; margin: 0 0 22px; display: grid; gap: 9px; flex: 1; }
.plan-perks li { font-size: .92rem; color: #4a3a2c; line-height: 1.6; }
.plan-card .btn { margin-top: auto; }
.pricing-note { text-align: center; margin-top: 28px; color: var(--soft-brown); font-size: .95rem; }
.pricing-note a { color: var(--accent-copper); font-weight: 800; text-decoration: none; }

/* ── Checkout ── */
.checkout-wrap { max-width: 980px; }
.co-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.co-box { background: var(--white); border-radius: 16px; box-shadow: var(--shadow); padding: 24px; }
.co-box h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 6px; }
.co-box h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 14px; }
.co-price { margin-bottom: 14px; }
.co-price .num { font-size: 1.9rem; font-weight: 800; color: var(--accent-copper); }
.pay-instructions { margin-top: 18px; padding-top: 18px; border-top: 1px dashed #e7d9c9; }
.pay-instructions p { color: var(--soft-brown); font-size: .92rem; line-height: 1.8; margin-bottom: 14px; }
.pay-row { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--bg-cream); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; }
.pay-k { font-weight: 800; font-size: .92rem; }
.pay-v { font-weight: 800; color: var(--accent-copper); direction: ltr; unicode-bidi: embed; word-break: break-all; }
.pay-amount { margin-top: 12px; font-size: 1.05rem; font-weight: 700; }
.pay-amount strong { color: var(--accent-copper); }
.pay-warn { margin-top: 12px; background: #fde8e7; color: #b3261e; border-radius: var(--radius); padding: 10px 14px; font-weight: 700; font-size: .9rem; }
.method-pick { display: flex; gap: 10px; }
.method-pick button { flex: 1; background: var(--bg-cream); border: 2px solid transparent; border-radius: var(--radius);
  padding: 12px; font: inherit; font-weight: 800; cursor: pointer; color: var(--primary-dark); }
.method-pick button.sel { border-color: var(--accent-copper); color: var(--accent-copper); }
.receipt-preview { width: 100%; max-height: 280px; object-fit: contain; margin-top: 12px;
  border-radius: var(--radius); border: 1px solid #e7d9c9; background: #fafafa; }
.success-box { text-align: center; padding: 20px 4px; }
.success-box .big-check { font-size: 3rem; }
.success-box h3 { margin: 8px 0; }
.success-box p { color: var(--soft-brown); line-height: 1.8; margin-bottom: 18px; }
input[type=file].input { padding: 10px; cursor: pointer; }

/* ── Upgrade banner CTA ── */
.banner-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.upgrade-banner .plans-btn { background: var(--accent-copper); color: #fff; text-decoration: none;
  font-weight: 800; padding: 10px 22px; border-radius: 99px; white-space: nowrap; }
.upgrade-banner .plans-btn:hover { background: #a4642f; }

/* ── Admin receipts ── */
.pending-dot { background: #b3261e; color: #fff; border-radius: 99px; padding: 1px 8px; font-size: .75rem; font-weight: 800; margin-inline-start: 4px; }
.img-modal { position: fixed; inset: 0; background: rgba(0,0,0,.8); display: flex; align-items: center;
  justify-content: center; z-index: 100; padding: 20px; cursor: zoom-out; }
.img-modal img { max-width: 96%; max-height: 92%; border-radius: 10px; box-shadow: 0 10px 50px rgba(0,0,0,.5); }

@media (max-width: 700px) { .co-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .auth-card { padding: 28px 20px; }
  .topbar .brand span { display: none; }
  /* الشريط العلوي كان بيتزنق على الموبايل: الاسم + 3 روابط + خروج في سطر واحد
     فيطلعوا مكرمشين ومش قابلين للضغط. بنخليه يلف على سطرين بدل ما يتزنق. */
  .topbar { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .topbar .brand img { height: 32px; }
  /* الروابط كانت بتلف على 3-4 صفوف (الدليل وصل 199px = ربع الشاشة) وهي شريط
     لاصق. بنخليها سطر واحد بيتمرّر أفقيًا، وزرار الخروج مثبّت في آخره عشان
     مايختفيش مع التمرير. */
  .topbar .user-box { gap: 8px; font-size: .78rem; flex-wrap: nowrap; overflow-x: auto;
    justify-content: flex-start; scrollbar-width: none; -ms-overflow-style: none;
    max-width: 100%; flex: 1 1 auto; }
  .topbar .user-box::-webkit-scrollbar { display: none; }
  .topbar .user-box > * { flex: 0 0 auto; white-space: nowrap; }
  .topbar .user-box > .logout-btn { position: sticky; inset-inline-end: 0;
    background: var(--primary-dark); margin-inline-start: auto; z-index: 3;
    box-shadow: -8px 0 0 var(--primary-dark), 8px 0 0 var(--primary-dark); }
  /* أهداف اللمس: الروابط دي كانت ~19px ارتفاع (padding: 2px 0) — أقل من نص
     الحد الأدنى الموصى بيه، فالضغط عليها بالإبهام كان بيوديك للرابط اللي جنبه. */
  .topbar .logout-btn { padding: 9px 12px; font-size: .78rem; }
  .topbar .sn-lang-btn { padding: 8px 10px; font-size: 11px; gap: 4px; min-height: 40px; }
  /* sn-lang-sticky-start: زرار اللغة كان آخر عنصر في شريط بيتمرّر أفقيًا (عرضه 477-788px
     على شاشة 366px) يعني مش ظاهر خالص على الموبايل في صفحات الملتقى. بنقدّمه لأول الشريط
     ونثبّته زي زرار الخروج على الناحية التانية عشان يفضل ظاهر مهما مرّرت. */
  .topbar .user-box > .sn-lang-btn { order: -1; position: sticky; inset-inline-start: 0;
    z-index: 3; background: var(--primary-dark);
    box-shadow: -8px 0 0 var(--primary-dark), 8px 0 0 var(--primary-dark); }
  .topbar .user-box > a { padding: 8px 6px; display: inline-block; }
  /* الاسم مالوش لازمة على الموبايل — بياخد سطر زيادة من شريط لاصق أصلاً */
  .topbar .user-box > #userName { display: none; }
  .wrap { padding: 16px 12px 40px; }
}
