/* ═══════════════════════════════════════════════════════════════
   assets/css/style.css
   سیستم محاسبه محرومیت از حقوق اجتماعی — ماده ۲۵ ق.م.ا ۱۳۹۲
   ═══════════════════════════════════════════════════════════════ */

/* ── فونت محلی (بدون ارجاع خارجی) ─────────────────────────── */
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: block;
}

/* ── متغیرها ────────────────────────────────────────────────── */
:root {
  --bg:          #0d1117;
  --surface:     #161b22;
  --surface2:    #1f2937;
  --border:      #30363d;
  --accent:      #c9a84c;
  --accent2:     #e6c97a;
  --accent-dim:  rgba(201,168,76,.12);
  --accent-glow: rgba(201,168,76,.25);
  --danger:      #da3633;
  --danger-dim:  rgba(218,54,51,.10);
  --success:     #2ea043;
  --text:        #e6edf3;
  --text-muted:  #8b949e;
  --radius:      10px;
  --shadow:      0 4px 24px rgba(0,0,0,.45);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base ───────────────────────────────────────────────────── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Vazirmatn', 'Segoe UI', Tahoma, 'B Nazanin', sans-serif;
  font-size: 15px;
  line-height: 1.75;
  min-height: 100vh;
  padding: 20px 16px 60px;
}

/* ── Header ─────────────────────────────────────────────────── */
header { text-align: center; padding: 36px 0 24px; }

.logo-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #1a2236, #2a3655);
  border: 1px solid var(--accent);
  border-radius: 50px;
  padding: 8px 22px;
  margin-bottom: 18px;
}
.logo-badge svg  { width: 22px; height: 22px; fill: var(--accent); }
.logo-badge span { font-size: 13px; color: var(--accent); letter-spacing: .4px; }

h1 {
  font-size: clamp(20px, 4vw, 30px);
  font-weight: 700;
  color: var(--accent2);
  text-shadow: 0 0 30px rgba(201,168,76,.35);
  margin-bottom: 8px;
}
.subtitle { color: var(--text-muted); font-size: 13px; }

/* ── Security badges ─────────────────────────────────────────── */
.sec-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 780px;
  margin: 0 auto 24px;
}
.sec-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11px;
  color: var(--text-muted);
}
.sec-badge svg { width: 12px; height: 12px; fill: var(--success); }

/* ── Card ────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  max-width: 780px;
  margin: 0 auto 20px;
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title svg { width: 18px; height: 18px; fill: var(--accent); }

/* ── Law box ─────────────────────────────────────────────────── */
.law-box {
  background: var(--surface2);
  border-right: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 16px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 2.1;
}
.law-box strong { color: var(--accent2); }

/* ── Error banner ────────────────────────────────────────────── */
.error-banner {
  background: var(--danger-dim);
  border: 1px solid rgba(218,54,51,.4);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 18px;
  color: #f85149;
  font-size: 13px;
  line-height: 1.9;
}
.error-banner ul { padding-right: 18px; margin: 0; }

/* ── Form fields ─────────────────────────────────────────────── */
.field { margin-bottom: 22px; }

label.field-label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
}
label.field-label em { color: var(--danger); font-style: normal; }

select,
input[type="text"],
input[type="number"] {
  width: 100%;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  direction: rtl;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .2s, box-shadow .2s;
}
select:focus,
input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
select option  { background: var(--surface2); }
select optgroup { color: var(--accent2); font-weight: 700; }

/* درپوش فلش select */
.select-wrap { position: relative; }
.select-wrap::after {
  content: '▼';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  pointer-events: none;
  font-size: 10px;
}

/* ── Radio end-type ──────────────────────────────────────────── */
.radio-group { display: flex; flex-direction: column; gap: 8px; }

.radio-opt {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.radio-opt:hover { border-color: var(--accent); }
.radio-opt input[type="radio"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  margin-top: 3px;
  flex-shrink: 0;
}
.radio-opt .opt-title { font-size: 13.5px; font-weight: 600; display: block; }
.radio-opt .opt-desc  { font-size: 11.5px; color: var(--text-muted); display: block; margin-top: 2px; }

/* ── Sub-notice ──────────────────────────────────────────────── */
.sub-notice {
  background: var(--danger-dim);
  border: 1px dashed rgba(218,54,51,.4);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 12px;
  color: #f0a0a0;
  margin-top: 10px;
  display: none;
  line-height: 1.8;
}
.sub-notice.show { display: block; }

/* ── Help text ───────────────────────────────────────────────── */
.help-text {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 7px;
  padding: 8px 10px;
  background: rgba(255,255,255,.03);
  border-radius: 6px;
  border-right: 2px solid var(--accent);
}

/* ── Date grid ───────────────────────────────────────────────── */
.date-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.date-label { font-size: 11px; color: var(--text-muted); text-align: center; margin-top: 4px; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-row { display: flex; gap: 12px; margin-top: 10px; flex-wrap: wrap; }

button {
  flex: 1;
  min-width: 130px;
  padding: 13px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  font-weight: 700;
  transition: opacity .2s, transform .1s;
}
button:active { transform: scale(.97); }

.btn-primary { background: linear-gradient(135deg, #c9a84c, #a07830); color: #0d1117; }
.btn-primary:hover { opacity: .9; }
.btn-reset   { background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border); }
.btn-reset:hover { border-color: var(--text-muted); }

/* ── Result card ─────────────────────────────────────────────── */
.result-card {
  background: linear-gradient(135deg, #1a2636, #0d1c2e);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 26px 24px;
  max-width: 780px;
  margin: 0 auto 20px;
  box-shadow: 0 0 40px rgba(201,168,76,.12);
}

.result-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent2);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.result-title svg { width: 20px; height: 20px; fill: var(--accent2); }

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-size: 13.5px;
  flex-wrap: wrap;
  gap: 6px;
}
.result-row:last-child { border-bottom: none; }
.rk { color: var(--text-muted); }
.rv { font-weight: 700; color: var(--text); }
.rv.red   { color: #f85149; }
.rv.green { color: #3fb950; }

/* ── Law chip ────────────────────────────────────────────────── */
.law-chip {
  display: inline-block;
  background: var(--accent-dim);
  border: 1px solid var(--accent-glow);
  border-radius: 20px;
  padding: 3px 14px;
  font-size: 11.5px;
  color: var(--accent2);
  margin-bottom: 16px;
}

/* ── Big date box ────────────────────────────────────────────── */
.big-date {
  text-align: center;
  margin: 20px 0 10px;
  padding: 20px;
  background: var(--accent-dim);
  border-radius: var(--radius);
  border: 1px solid var(--accent-glow);
}
.big-date .bd-label { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.big-date .bd-date  { font-size: clamp(22px, 5vw, 34px); font-weight: 700; color: var(--accent2); }
.big-date .bd-greg  { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

/* ── Already free ────────────────────────────────────────────── */
.already-free {
  text-align: center;
  padding: 30px 20px;
  color: var(--success);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.9;
}
.already-free .check-icon { font-size: 48px; display: block; margin-bottom: 10px; }

/* ── Timeline ────────────────────────────────────────────────── */
.timeline       { margin: 24px 0 0; }
.timeline-title { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; font-weight: 600; letter-spacing: .3px; }

.tl-item { display: flex; gap: 14px; margin-bottom: 18px; }
.tl-dot  {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 4px;
  flex-shrink: 0;
  position: relative;
}
.tl-dot::after {
  content: '';
  position: absolute;
  top: 12px;
  left: 5px;
  width: 2px;
  height: 30px;
  background: var(--border);
}
.tl-item:last-child .tl-dot::after { display: none; }
.tl-text .t-date { font-size: 12px; color: var(--accent); margin-bottom: 2px; }
.tl-text .t-desc { font-size: 13px; }

/* ── Warning banner ──────────────────────────────────────────── */
.warning-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--danger-dim);
  border: 1px solid rgba(218,54,51,.3);
  border-radius: 8px;
  padding: 13px 14px;
  margin-top: 20px;
  font-size: 12px;
  color: #f0a0a0;
  line-height: 1.8;
}
.warning-banner svg { width: 18px; height: 18px; fill: #f85149; flex-shrink: 0; margin-top: 2px; }

/* ── Divider ─────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* ── Footer ──────────────────────────────────────────────────── */
footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 11.5px;
  padding: 28px 0 0;
  max-width: 780px;
  margin: 0 auto;
  border-top: 1px solid var(--border);
  line-height: 2;
}
footer .footer-law { margin-top: 6px; color: #3d444d; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 540px) {
  .date-grid  { grid-template-columns: 1fr 1fr; }
  .btn-row    { flex-direction: column; }
  .result-row { flex-direction: column; align-items: flex-start; gap: 2px; }
  .rk         { font-size: 12px; }
  .card       { padding: 20px 16px; }
}
