/* cards.css */

:root{
  --navy:#1b1f7a;
  --ink:#111;
  --green:#3a9a1c;
  --orange:#f25a1d;
  --blue:#4a90d9;
  --logo:#2f8ad6;        /* رنگ لوگو: برای تغییر فقط همین را عوض کنید */
  --logo-tint:#e7f1fb;   /* نسخهٔ کم‌رنگ رنگ لوگو برای سطرها */
  --font:'Vazirmatn',Tahoma,Arial,sans-serif;
}

*{box-sizing:border-box}
html,body{margin:0}
body.card-page{
  font-family:var(--font);
  background:#e9edf3;
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px 12px;
  direction:rtl;
}
.card{position:relative;overflow:hidden;background:#fff;box-shadow:0 10px 30px rgba(20,30,60,.18);border-radius:14px}
.card dl,.card dd,.card dt,.card h1,.card p{margin:0;padding:0}

.card__warn{position:relative;z-index:5;background:#fff3cd;color:#7a5b00;font-size:12px;line-height:1.6;padding:6px 12px;text-align:center}
.card__badge{
  position:absolute;left:18px;top:18px;
  background:#c62828;color:#fff;font-weight:800;font-size:14px;
  padding:6px 14px;border-radius:6px;transform:rotate(-6deg);
}
.is-expired{text-decoration:line-through;text-decoration-thickness:2px}

/* ════════ کارت مشترک (عمودی، جدولی) ════════ */
.card--subscriber{
  width:min(100%,490px);
  padding:24px 22px 18px;
  border-radius:32px;
}
.sub__top{
  display:flex;align-items:center;justify-content:center;
  gap:clamp(20px,8%,50px);margin-bottom:20px;
}
.sub__logo{width:clamp(150px,48%,240px);height:auto;display:block}

.sub__table{
  display:flex;flex-direction:column;gap:1mm;
  width:100%;margin-bottom:5mm;
  font-size:clamp(15px,4.4vw,21px);color:#000;
}
.sub__table thead,.sub__table tbody{display:flex;flex-direction:column;gap:1mm}
.sub__table tr{
  display:grid;grid-template-columns:38% 1fr;
  background:#fff;border-radius:14px;overflow:hidden;
  box-shadow:0 1px 5px rgba(20,50,100,.20);
}
.sub__table th,.sub__table td{border:0;padding:8px 12px;line-height:1.35;word-break:break-word;min-width:0}
.sub__table th{font-weight:700;text-align:right;color:var(--logo)}
.sub__table td{font-weight:800;text-align:center}
.sub__table tbody tr:nth-child(even){background:var(--logo-tint)}
.sub__table .v-name{font-size:.95em}

/* أفراد العائلة */
.sub__family tr{grid-template-columns:var(--cols,1fr 1fr)}
.sub__family th,.sub__family td{text-align:center}
.sub__family .t-title,.sub__family .t-head{background:var(--logo)}
.sub__family .t-title th{grid-column:1/-1;font-size:1.08em}
.sub__family .t-title th,.sub__family .t-head th{color:#fff}

.sub__slogan{text-align:center;font-weight:600;font-size:clamp(16px,4.6vw,22px);color:#111;padding-top:2px}

/* ════════ کارت کارمند (عمودی) ════════ */
.card--employee{
  width:min(100%,415px);
  min-height:min(160vw,665px);
  padding:0;border-radius:22px;
  background:#f3f5f8;
  display:flex;flex-direction:column;
  color:#000;
}
.emp__bg{position:absolute;inset:0;width:100%;height:100%;z-index:0;pointer-events:none}
.card--employee > *:not(.emp__bg){position:relative;z-index:1}

/* لوگوها: هلال احمر راست ، بیمارستان چپ (صفحه راست‌به‌چپ است) */
.emp__logos{display:flex;justify-content:space-between;align-items:flex-start;padding:8% 7% 0 8%}
.emp__rc{display:flex;flex-direction:column;align-items:flex-start;gap:7px}
.emp__rc img{width:min(36vw,var(--rc-width,150px));height:auto;display:block}   /* عرض لوگوی هلال احمر: برای تغییر، --rc-width را عوض کنید */
.emp__hosp img{width:min(34vw,var(--hosp-width,140px));height:auto;display:block}

.emp__photo{
  width:52%;aspect-ratio:1;margin:4.5% auto 0;border-radius:50%;
  border:6px solid #5a7184;box-shadow:0 0 0 3px #e4e9ee,0 4px 14px rgba(20,40,70,.22);
  overflow:hidden;background:#cdd5dd url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><circle cx='50' cy='38' r='17' fill='%23fff'/><path d='M14 100c0-24 15-37 36-37s36 13 36 37z' fill='%23fff'/></svg>") center/cover no-repeat;
}
.emp__photo img{width:100%;height:100%;object-fit:cover;display:block}

.emp__body{padding:0 17% 0 6%;margin-top:-3.5%}
.emp__name{margin:0;display:flex;justify-content:flex-start}
.emp__name span{
  display:inline-block;background:#fff;padding:2px 14px;border-radius:2px;
  font-size:clamp(22px,6.9vw,28px);font-weight:500;color:#222;line-height:1.5;
  box-shadow:0 1px 4px rgba(20,40,70,.12);
}
.emp__job{margin:clamp(8px,2.6vw,12px) 0 0;text-align:right;color:#1f5f9f;font-size:clamp(19px,5.8vw,24px);font-weight:400;line-height:1.4}

.emp__meta{margin:clamp(14px,5vw,22px) 0 0;display:flex;flex-direction:column;gap:1px}
.emp__meta div{display:flex;align-items:baseline;justify-content:flex-start;gap:10px}
.emp__meta dt{font-weight:700;font-size:clamp(15px,4.6vw,19px);white-space:nowrap}
.emp__meta dd{font-weight:700;font-size:clamp(17px,5.3vw,22px);direction:ltr;unicode-bidi:isolate;letter-spacing:.5px}
.emp__meta dd.is-expired{color:#c62828;text-decoration:line-through;text-decoration-thickness:2px}

.emp__footer{
  margin-top:auto;padding:12px 3.5% clamp(12px,4.5vw,20px);
  display:flex;flex-direction:column;align-items:center;gap:10px;
}
.emp__address{
  text-align:center;font-size:clamp(9px,2.8vw,11.6px);font-weight:700;line-height:1.5;color:#111;
}
.emp__insta{
  display:flex;align-items:center;gap:12px;text-decoration:none;color:#111;
  background:rgba(255,255,255,.85);padding:7px 12px;border-radius:14px;
  box-shadow:0 1px 5px rgba(20,40,70,.18);
}
.emp__qr{width:min(19vw,78px);height:auto;display:block;flex:none;border-radius:6px}
.emp__insta-text{display:flex;flex-direction:column;gap:2px;font-size:clamp(10.5px,3vw,12.5px);font-weight:600;line-height:1.4}
.emp__insta-text strong{font-size:clamp(10px,2.9vw,12px);color:#1f5f9f;font-weight:700;letter-spacing:.2px}

/* ════════ موبایل / چاپ ════════ */
@media (max-width:520px){
  body.card-page{padding:12px 6px}
  .card--subscriber{padding:18px 12px 14px}
}
@media print{
  body.card-page{background:#fff;padding:0}
  .card{box-shadow:none}
}

/* ════════ صفحهٔ استعلام ════════ */
body.lookup-page{align-items:flex-start}
.lookup{width:min(100%,490px);display:flex;flex-direction:column;gap:16px;margin:0 auto}
.lookup .card{width:100%}

.lk-head{display:flex;flex-direction:column;align-items:center;gap:8px;text-align:center}
.lk-head img{width:clamp(130px,40%,190px);height:auto}
.lk-head h1{margin:0;font-size:clamp(18px,5vw,24px);font-weight:800;color:var(--logo)}

.lk-box{
  background:#fff;border-radius:24px;padding:20px;
  box-shadow:0 1px 6px rgba(20,50,100,.20);
}
.lk-box label{display:block;font-weight:700;color:var(--logo);margin-bottom:6px}
.lk-box input[type=text],.lk-box input[type=password]{
  width:100%;height:46px;padding:0 14px;font:inherit;font-size:18px;
  border:1.5px solid #cfdcec;border-radius:14px;background:#f7fafd;outline:none;
}
.lk-box input[type=text]:focus,.lk-box input[type=password]:focus{border-color:var(--logo);background:#fff}
.lk-box p{margin:0 0 12px}
.lk-box .login-remember{display:none}

.lk-btn,.lk-box input[type=submit]{
  display:inline-flex;align-items:center;justify-content:center;
  height:46px;padding:0 24px;font:inherit;font-size:17px;font-weight:700;
  color:#fff;background:var(--logo);border:0;border-radius:14px;cursor:pointer;text-decoration:none;
}
.lk-btn:hover,.lk-box input[type=submit]:hover{filter:brightness(.93)}
.lk-btn--ghost{background:var(--logo-tint);color:var(--logo)}
.lk-box input[type=submit]{width:100%}

.lk-row{display:flex;gap:10px}
.lk-row input{flex:1;min-width:0}

.lk-msg{font-weight:600;font-size:15px;border-radius:12px;padding:10px 14px}
.lk-msg--err{background:#fdecec;color:#b42318}

.lk-bar{
  display:flex;justify-content:space-between;align-items:center;
  font-size:15px;color:#33475b;padding:0 6px;
}
.lk-bar a{color:var(--logo);font-weight:700;text-decoration:none}

/* ════════ جدول سه‌ستونه أفراد العائلة (با الرقم الوطني) ════════ */
.sub__family--c3{font-size:clamp(13px,3.6vw,17px)}
.sub__family--c4{font-size:clamp(11.5px,3.1vw,15px)}
.sub__table .v-mobile{direction:ltr;unicode-bidi:plaintext}
.sub__family .v-nid,.sub__family .v-birth{direction:ltr;font-variant-numeric:tabular-nums}
.sub__family .t-title th{grid-column:1/-1}

/* ════════ صفحهٔ مدیران ════════ */
.lookup--wide{width:min(98%,1500px)}
.lk-hint{margin:0;font-size:14px;color:#52667a;padding:0 4px}
.lk-listsearch{align-items:center;padding:12px}
.lk-listsearch input{flex:1;min-width:0;height:46px;padding:0 14px;font:inherit;font-size:16px;border:1.5px solid #cfdcec;border-radius:14px;background:#f7fafd;outline:none}
.lk-listsearch input:focus{border-color:var(--logo);background:#fff}

.lk-tablewrap{overflow-x:auto;border-radius:18px;box-shadow:0 1px 6px rgba(20,50,100,.20);background:#fff}
.lk-list{width:100%;border-collapse:collapse;font-size:14.5px}
.lk-list thead th{background:var(--logo);color:#fff;font-weight:700;padding:11px 8px;text-align:right;white-space:nowrap}
.lk-list td{padding:10px 8px;border-bottom:1px solid #e6edf5;text-align:right;white-space:nowrap}
.lk-list td.l-name{white-space:normal;min-width:150px}
.lk-list tbody tr:nth-child(even){background:var(--logo-tint)}
.lk-list tbody tr[data-url]{cursor:pointer}
.lk-list tbody tr[data-url]:hover,.lk-list tbody tr[data-url]:focus{background:#d3e6f8;outline:none}
.lk-list .l-name{font-weight:700}
.lk-list .l-num{direction:ltr;text-align:right;font-variant-numeric:tabular-nums}
.lk-list .l-empty{text-align:center;padding:28px;color:#52667a}
.l-badge{display:inline-block;padding:2px 12px;border-radius:99px;font-size:13px;font-weight:700}
.l-badge.is-on{background:#e3f6e8;color:#1e7a39}
.l-badge.is-off{background:#fdecec;color:#b42318}
.l-open{color:var(--logo);font-weight:700;text-decoration:none}
.lk-pager{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px 12px;font-size:15px}
.lk-pager__go{display:flex;align-items:center;gap:8px;margin:0}
.lk-pager__go input{width:76px;height:40px;padding:0 8px;text-align:center;font:inherit;font-size:15px;border:1.5px solid #cfdcec;border-radius:12px;background:#f7fafd;outline:none}
.lk-pager__go input:focus{border-color:var(--logo);background:#fff}
.lk-pager__go .lk-btn{width:auto}
.lk-pager .lk-btn{height:40px;padding:0 18px;font-size:15px}
@media print{.lk-bar,.lk-head{display:none}}

/* ════════ تسجيل مشترك جديد ════════ */
.lk-btn--block{display:flex;width:100%}
.lk-newbtn{background:var(--logo)}
.lk-msg--ok{background:#e3f6e8;color:#1e7a39;margin:0 0 14px}
.lk-msg--ok strong{display:block;margin-top:4px;font-size:1.1em}
.lk-actions{display:flex;gap:10px;flex-wrap:wrap}
.lk-actions .lk-btn{flex:1}

.lk-new{display:flex;flex-direction:column;gap:14px}
.lk-field{display:flex;flex-direction:column;gap:6px}
.lk-field label{margin:0}
.lk-field input[type=text],.lk-field input[type=date]{
  width:100%;height:46px;padding:0 14px;font:inherit;font-size:17px;
  border:1.5px solid #cfdcec;border-radius:14px;background:#f7fafd;outline:none;
}
.lk-field input:focus{border-color:var(--logo);background:#fff}
.lk-field input.is-locked{background:#eef2f6;color:#5a6b7d;border-style:dashed;font-weight:800;letter-spacing:.5px}
.lk-field small{color:#52667a;font-size:13px}

.lk-family{border:1.5px dashed #cfdcec;border-radius:16px;padding:12px;margin:0}
.lk-family legend{padding:0 8px;font-weight:700;color:var(--logo)}
.lookup--form{width:min(100%,900px)}
.lk-fm-head,.lk-fm-row{display:grid;grid-template-columns:1.5fr .9fr 1.2fr 2.3fr 42px;gap:10px}
.lk-fm-head{margin-bottom:6px;font-size:13px;font-weight:700;color:var(--logo)}
.lk-fm-row{margin-bottom:8px}
.lk-fm-row input{height:42px;min-width:0;padding:0 10px;font:inherit;font-size:15px;border:1.5px solid #cfdcec;border-radius:12px;background:#f7fafd;outline:none}
.lk-fm-row input:focus{border-color:var(--logo);background:#fff}
.lk-fm-del{width:42px;height:42px;border:0;border-radius:12px;background:#fdecec;color:#b42318;font-size:22px;line-height:1;cursor:pointer}
@media (max-width:520px){
  .lk-fm-head{display:none}
  .lk-fm-row{grid-template-columns:1fr 1fr 42px}
  .lk-fm-row > :nth-child(3),.lk-fm-row > .lk-date{grid-column:1 / 3}
  .lk-fm-del{grid-row:1 / span 3;grid-column:3;height:auto}
}

/* ---- دکمهٔ ویرایش زیر کارت مشترک ---- */
.lk-editwrap{margin-top:12px}
.lk-editbtn{background:#e8a317;color:#1b1b1b}
.lk-editbtn:hover{filter:brightness(.95)}
@media print{.lk-editwrap{display:none}}

/* ---- صفحهٔ استعلام: وقتی کارت نمایش داده می‌شود عریض‌تر تا رقم وطنی و تاریخ تولد افراد عائله در یک خط بمانند ---- */
.lookup--card{width:min(100%,780px)}
.lookup--card .sub__family{font-size:16px}
.lookup--card .sub__family .v-nid,.lookup--card .sub__family .v-birth{white-space:nowrap}
@media (max-width:560px){
  .lookup--card .sub__family{font-size:clamp(11.5px,3.1vw,15px)}
  .lookup--card .sub__family .v-nid,.lookup--card .sub__family .v-birth{white-space:normal}
}

/* ---- ثبت‌نام آنلاین و طلبات التسجيل ---- */
.lk-intro{margin:0;text-align:center;color:#33475b;font-size:15px;line-height:1.7}
.lk-btn--danger{background:#fdecec;color:#b42318}
.lk-badge{display:inline-flex;align-items:center;justify-content:center;min-width:24px;height:24px;padding:0 7px;margin-inline-start:8px;border-radius:12px;background:#d92d20;color:#fff;font-size:13px;font-weight:800}
.lk-req{display:flex;flex-direction:column;gap:14px}
.lk-req table{width:100%;border-collapse:collapse;font-size:15px}
.lk-req__info th{width:34%;text-align:right;color:var(--logo);font-weight:700;padding:6px 8px}
.lk-req__info td{font-weight:800;padding:6px 8px}
.lk-req__info tr:nth-child(odd){background:var(--logo-tint)}
.lk-req__fam{border:1.5px dashed #cfdcec;border-radius:12px;overflow:hidden}
.lk-req__fam th{background:var(--logo);color:#fff;padding:7px 8px;font-size:14px}
.lk-req__fam td{text-align:center;padding:7px 8px;border-top:1px solid #e3ebf5}
.lk-req__fam td[dir=ltr]{white-space:nowrap}
.lk-req .lk-actions form{flex:1;display:flex}
.lk-req .lk-actions form .lk-btn{flex:1}

/* ---- لیست‌های تاریخ: سال ← ماه ← روز ---- */
.lk-date{display:flex;gap:6px;min-width:0}
.lk-date select{flex:1 1 0;min-width:0;height:42px;padding:0 6px;font:inherit;font-size:15px;color:inherit;border:1.5px solid #cfdcec;border-radius:12px;background:#f7fafd;outline:none;cursor:pointer}
.lk-date select:focus{border-color:var(--logo);background:#fff}
.lk-date select:disabled{background:#eef2f6;color:#8a99ab;cursor:not-allowed}
.lk-date .lk-date__y{flex:1.15 1 0}
.lk-date .lk-date__m{flex:1.7 1 0}
.lk-intro--small{font-size:13.5px;margin:6px 0 10px}
.lk-intro--req{font-weight:700;color:#b42318}

.lk-date .lk-date__m{direction:ltr;text-align:left}

.l-badge.is-online{background:#e3f1ff;color:#0b5cad}
.l-badge.is-staff{background:#eef2f6;color:#33475b}

/* ---- نوع رقم وطنی: دکمه‌های رادیویی ---- */
.lk-radios{display:flex;flex-wrap:wrap;gap:10px}
.lk-radio{display:inline-flex;align-items:center;gap:8px;padding:9px 16px;border:1.5px solid #cfdcec;border-radius:12px;background:#f7fafd;font-size:15px;font-weight:700;cursor:pointer}
.lk-radio input{width:18px;height:18px;margin:0;accent-color:var(--logo);cursor:pointer}
.lk-radio:has(input:checked){border-color:var(--logo);background:#e8f3fc}
.lk-nid-hint{display:block;margin-top:6px;font-size:13.5px;font-weight:700;color:#b54708}
.lk-nid-hint:empty{display:none}

/* ════════ فرم ثبت‌نام داخل المنتور (شورت‌کد [card_register]) ════════ */
.cards-embed{font-family:var(--font);direction:rtl;padding:12px 0}
.cards-embed .lookup{margin:0 auto}

/* ---- ستون نوع کارت: دایرهٔ نقره‌ای (5 دينار) و طلایی (25 دينار) ---- */
.l-plan{text-align:center}
.l-coin{display:inline-block;width:24px;height:24px;border-radius:50%;vertical-align:middle}
.l-coin.is-silver{background:radial-gradient(circle at 30% 28%,#fff 0%,#e6e9ed 35%,#a9b0b8 75%,#8b929a 100%);border:1.5px solid #7c848d;box-shadow:0 1px 3px rgba(0,0,0,.25)}
.l-coin.is-gold{background:radial-gradient(circle at 30% 28%,#fff6c9 0%,#f6d35a 35%,#d9a514 75%,#b5830a 100%);border:1.5px solid #a17408;box-shadow:0 1px 3px rgba(0,0,0,.3)}

/* ستون نوع کارت: دایره وسط‌چین */
.lk-list td.l-plan,.lk-list thead th:nth-child(6){text-align:center}
.lk-list td.l-plan .l-coin{display:block;margin:0 auto}
/* صفحهٔ کوچک: بدون اسکرول افقی، متن‌ها اجازهٔ شکستن دارند */
@media (max-width:900px){
  .lk-list{font-size:13px}
  .lk-list td{white-space:normal;padding:8px 5px}
  .lk-list thead th{white-space:normal;padding:9px 5px}
}

/* توضیح فرق کارت 5 و 25 دينار در فرم ثبت‌نام آنلاین */
.lk-plan-desc{list-style:none;margin:10px 0 0;padding:0;display:flex;flex-direction:column;gap:8px}
.lk-plan-desc li{padding:10px 12px;border-radius:12px;background:#f1f6fb;font-size:14px;line-height:1.8;color:#33475b}
.lk-plan-desc .l-coin{width:16px;height:16px;margin-inline-end:8px;vertical-align:-2px}
.lk-plan-desc a{font-weight:700;color:var(--logo)}
