/* استایل مشترک پنل مشتری، پنل مدیریت و صفحه‌های ورود — فونت وزیرمتن از همین سرور سرو میشه */
@font-face {
  font-family: "Vazirmatn";
  src: url("/assets/fonts/Vazirmatn-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --font: "Vazirmatn", Tahoma, "Segoe UI", sans-serif;

  --ink: #10231f;
  --ink-soft: #34504a;
  --muted: #5f716d;
  --paper: #edf2f0;
  --surface: #ffffff;
  --line: #d3deda;

  --teal: #0e5a50;
  --teal-deep: #0a4139;
  --teal-wash: #e1efeb;

  --saffron: #d9930d;
  --saffron-text: #8a5a00;
  --saffron-wash: #fbf0d9;

  --live: #22a06b;
  --red: #b93636;
  --red-wash: #fbe6e4;

  --r-card: 16px;
  --r-field: 10px;
  --focus: 0 0 0 3px rgba(217, 147, 13, 0.55);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper);
  margin: 0;
}

h1, h2, h3 { font-weight: 800; line-height: 1.4; margin: 0; }

:focus-visible { outline: none; box-shadow: var(--focus); }

/* ---------- فرم ---------- */
label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-soft); margin: 14px 0 6px; }

input[type="text"], input[type="password"], input[type="number"], input[type="date"],
input[list], select, textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-field);
  padding: 10px 12px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-wash); }
input[type="file"] { font-family: inherit; font-size: 13.5px; max-width: 100%; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--teal); }

.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.8; }

/* ---------- دکمه ---------- */
button {
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--r-field);
  border: 1px solid transparent;
  padding: 9px 18px;
  cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
}
button:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--teal-deep); }

.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover:not(:disabled) { border-color: var(--teal); color: var(--teal); }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #9a2b2b; }

.btn-quiet { background: transparent; color: var(--red); border-color: transparent; padding: 6px 10px; font-weight: 500; }
.btn-quiet:hover:not(:disabled) { background: var(--red-wash); }

.btn-sm { font-size: 12.5px; padding: 6px 12px; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }

/* ---------- کارت ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 22px 24px;
}
.card > h2 { font-size: 17px; }
.card > .lead { color: var(--muted); font-size: 13.5px; margin: 4px 0 18px; }

/* ---------- نشان‌ها ---------- */
.badge { display: inline-block; padding: 2px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-ok { background: var(--teal-wash); color: var(--teal-deep); }
.badge-expired { background: var(--saffron-wash); color: var(--saffron-text); }
.badge-revoked { background: var(--red-wash); color: var(--red); }
.badge-active { background: var(--teal-wash); color: var(--teal-deep); }

/* ---------- جدول ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: right; font-weight: 700; font-size: 12.5px; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { text-align: right; padding: 9px 10px; border-bottom: 1px solid #e8eeec; vertical-align: middle; }
tbody tr:hover { background: #f6f9f8; }
code { font-family: Consolas, monospace; background: var(--paper); padding: 1px 7px; border-radius: 6px; font-size: 12.5px; }

/* ---------- پیام‌ها (toast) ---------- */
#toastHost { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 1000; width: min(92vw, 420px); pointer-events: none; }
.toast {
  background: var(--ink); color: #fff; border-radius: 12px; padding: 11px 16px; font-size: 13.5px; line-height: 1.7;
  pointer-events: auto;
  animation: toast-in .22s ease-out;
}
.toast.error { background: var(--red); }
.toast.success { background: var(--teal-deep); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
