/* پارس آموز — کارنامه‌ساز رایگان (/ابزار/کارنامه-ساز-رایگان/): the form, the scaled preview, and the cards that print.
   Cards are measured in real millimetres (A4 210×297, or A5 210×148.5 two to a sheet), so preview and paper match. */

.rc-grid { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 28px; align-items: start; }
.rc-form { padding: 22px; display: grid; gap: 14px; }
.rc-form:hover { transform: none; box-shadow: none; border-color: var(--line); } /* .card lifts on hover; a form should stay put */
.rc-form h2 { font-size: 1.15rem; margin: 0; }
.rc-form h3 { font-size: .98rem; margin: 6px 0 0; color: var(--ink-800); }
.rc-field { display: grid; gap: 6px; font-weight: 700; font-size: .92rem; color: var(--ink-800); }
.rc-field small { font-weight: 400; color: var(--ink-500); }
.rc-field input, .rc-field select, .rc-field textarea { width: 100%; font: inherit; font-weight: 400; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink-900); }
.rc-field textarea { min-height: 210px; font-size: .86rem; line-height: 1.7; white-space: pre; overflow-x: auto; tab-size: 14; resize: vertical; }
.rc-field input:focus-visible, .rc-field select:focus-visible, .rc-field textarea:focus-visible { outline: 2px solid var(--brand-400); outline-offset: 1px; border-color: var(--brand-400); }
.rc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rc-help { margin: -6px 0 0; font-size: .82rem; line-height: 1.8; color: var(--ink-500); }
.rc-hint { margin: 0; min-height: 1.5em; font-size: .86rem; color: var(--ink-700); }
.rc-issues:empty { display: none; }
.rc-issues { padding: 10px 12px; border-radius: 10px; background: #FFF7E6; color: #7A4B00; font-size: .82rem; line-height: 1.8; }
.rc-issues ul { margin: 4px 0 0; padding-inline-start: 18px; }
.rc-checks { display: grid; gap: 8px; }
.rc-check { display: flex; gap: 8px; align-items: center; font-size: .92rem; cursor: pointer; }
.rc-check input { width: 18px; height: 18px; accent-color: var(--brand-600); }
.rc-is-desc .rc-num-only { display: none; }
.rc-actions { display: grid; gap: 10px; }
.rc-actions .btn { width: 100%; justify-content: center; }
.rc-note { display: flex; gap: 6px; align-items: center; margin: 0; font-size: .8rem; color: var(--ink-500); }
.rc-note svg { width: 14px; height: 14px; flex: none; }

.rc-preview { min-width: 0; position: sticky; top: 92px; }
.rc-preview-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: .9rem; font-weight: 700; color: var(--ink-800); }
.rc-preview-bar select { flex: 1; min-width: 0; font: inherit; font-weight: 400; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink-900); }
.rc-paper-wrap { position: relative; overflow: hidden; border-radius: 6px; background: #fff; box-shadow: 0 18px 40px -18px rgba(15, 23, 42, .35), 0 0 0 1px var(--line); }
.rc-sheet { width: 210mm; transform-origin: top right; }
.rc-caption { margin-top: 10px; text-align: center; font-size: .82rem; color: var(--ink-500); }

.rc-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.rc-step { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.rc-step b { display: block; margin-bottom: 6px; }
.rc-step p { margin: 0; font-size: .92rem; color: var(--ink-600); line-height: 1.9; }

.rc-embed { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.rc-embed code { flex: 1 1 320px; min-width: 0; overflow-x: auto; white-space: nowrap; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-soft); font-size: .82rem; }

@media (max-width: 900px) {
  .rc-grid { grid-template-columns: minmax(0, 1fr); }
  .rc-preview { position: static; }
  .rc-steps { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- the card ---------- */
.rc-page { box-sizing: border-box; width: 210mm; height: 297mm; padding: 13mm 12mm 8mm; display: flex; flex-direction: column; gap: 4.5mm; direction: rtl; background: #fff; color: #111; font-size: 10.5pt; }
.rc-head { display: flex; justify-content: space-between; align-items: center; gap: 6mm; padding-bottom: 3mm; border-bottom: .6mm solid #111; }
.rc-titles { display: grid; gap: 1.2mm; }
.rc-school { font-size: 15pt; font-weight: 800; line-height: 1.35; }
.rc-title { font-size: 11.5pt; font-weight: 700; color: #333; }
.rc-year { flex: none; display: grid; justify-items: center; gap: .8mm; padding: 2mm 4mm; border: .3mm solid #111; border-radius: 2mm; font-size: 8.5pt; color: #444; }
.rc-year b { font-size: 11pt; color: #111; }
.rc-info { display: flex; flex-wrap: wrap; gap: 2mm 8mm; padding: 2.5mm 3.5mm; border: .3mm solid #999; border-radius: 2mm; background: #F6F8F9; }
.rc-info i, .rc-sum i, .rc-note i { font-style: normal; color: #555; }
.rc-tables { display: flex; gap: 4mm; }
.rc-tables--2 > .rc-table { flex: 1; min-width: 0; }
.rc-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.rc-table th, .rc-table td { border: .25mm solid #444; padding: 1.6mm 2mm; text-align: center; vertical-align: middle; }
.rc-table th { background: #E9EEF0; font-size: 9pt; font-weight: 700; }
.rc-table td.rc-c { text-align: right; font-weight: 700; }
.rc-table .rc-n { width: 9mm; color: #555; }
.rc-table .rc-w, .rc-table .rc-m, .rc-table .rc-ca { width: 17mm; }
.rc-table td.rc-m { font-weight: 800; font-size: 11pt; }
.rc-table td.rc-words { font-size: 9pt; color: #333; }
.rc-table .rc-lv { width: 22mm; font-size: 8.5pt; }
.rc-table td.rc-lv { font-size: 12pt; font-weight: 800; }
.rc-low { text-decoration: underline; text-underline-offset: .8mm; }
.rc-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2mm 8mm; padding: 2.5mm 3.5mm; border: .4mm solid #111; border-radius: 2mm; }
.rc-sum b { font-size: 12.5pt; }
.rc-sum small { font-size: 9pt; color: #444; }
.rc-foot-note { margin-inline-start: auto; font-size: 8pt; color: #555; }
.rc-note { min-height: 16mm; padding: 2mm 3.5mm; border: .3mm dashed #888; border-radius: 2mm; line-height: 1.9; }
.rc-sign { display: flex; justify-content: space-between; gap: 10mm; margin-top: auto; padding: 0 6mm; }
.rc-sign span { flex: 1; display: grid; justify-items: center; gap: 1mm; padding-top: 14mm; border-top: .25mm dotted #777; font-size: 9pt; color: #444; }
.rc-sign small { font-size: 8.5pt; color: #222; font-weight: 700; }
.rc-foot { text-align: center; font-size: 7.5pt; color: #888; }

/* two to a sheet: A5 landscape halves of an A4 portrait page */
.rc-page--half { height: 148.5mm; padding: 7mm 9mm 4mm; gap: 2.4mm; font-size: 8.5pt; }
.rc-page--half .rc-head { padding-bottom: 1.6mm; }
.rc-page--half .rc-school { font-size: 12pt; }
.rc-page--half .rc-title { font-size: 9.5pt; }
.rc-page--half .rc-year { padding: 1mm 3mm; font-size: 7.5pt; }
.rc-page--half .rc-year b { font-size: 9pt; }
.rc-page--half .rc-info, .rc-page--half .rc-sum { padding: 1.4mm 2.5mm; }
.rc-page--half .rc-table th, .rc-page--half .rc-table td { padding: .9mm 1.4mm; }
.rc-page--half .rc-table th { font-size: 7.5pt; }
.rc-page--half .rc-table td.rc-m { font-size: 9pt; }
.rc-page--half .rc-table .rc-lv { width: 16mm; font-size: 7pt; }
.rc-page--half .rc-table td.rc-lv { font-size: 10pt; }
.rc-page--half .rc-sum b { font-size: 10pt; }
.rc-page--half .rc-note { min-height: 8mm; padding: 1.2mm 2.5mm; line-height: 1.6; }
.rc-page--half .rc-sign span { padding-top: 7mm; font-size: 7.5pt; }
.rc-page--half .rc-foot { font-size: 6.5pt; }
.rc-pair { width: 210mm; height: 297mm; display: flex; flex-direction: column; }
.rc-pair .rc-page--half + .rc-page--half { border-top: .3mm dashed #999; }

/* ---------- printing: only the cards ---------- */
#rc-print { display: none; }
@media print {
  @page { size: A4; margin: 0; }
  /* the page is printed at phone width, where main.css pads <body> for the bottom bar: that padding alone made a blank page */
  html, body { margin: 0 !important; padding: 0 !important; min-height: 0 !important; background: #fff !important; }
  body > *:not(#rc-print) { display: none !important; }
  #rc-print { display: block; }
  #rc-print > .rc-page, #rc-print > .rc-pair { height: 296mm; overflow: hidden; break-after: page; page-break-after: always; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #rc-print > .rc-pair .rc-page--half { height: 148mm; overflow: hidden; }
  #rc-print > :last-child { break-after: auto; page-break-after: auto; }
}
.rc-desc-only { display: none; }
.rc-is-desc .rc-desc-only { display: block; }
.rc-form .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.rc-school.rc-blank { display: block; width: 70mm; min-height: 8mm; border-bottom: .3mm dotted #777; } /* no school name given: a line to write it on */
.rc-page:not(.rc-page--half) .rc-note { min-height: 28mm; }
