/* Greece preliminary assessment: official-style form. Prefix gr- and dp- only. */
:root {
  --gr-ink: #0B1F3A;
  --gr-navy: #0B3D6B;
  --gr-blue: #0D5EAF;
  --gr-blue-soft: #E4EEFB;
  --gr-line: #D9E1EC;
  --gr-paper: #F6F8FB;
  --gr-muted: #5B6B7F;
  --gr-error: #B42318;
  --gr-error-soft: #FDECEA;
  --gr-ok: #1B7A3D;
}

.gr-page {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  color: var(--gr-ink);
  background: var(--gr-paper);
  min-height: 100vh;
  line-height: 1.85;
}
.gr-page *, .gr-page *::before, .gr-page *::after { box-sizing: border-box; }

/* Hero */
.gr-hero { background: linear-gradient(135deg, var(--gr-navy), var(--gr-ink)); color: #fff; padding: 40px 16px 56px; }
.gr-hero-inner { max-width: 960px; margin: 0 auto; display: flex; gap: 24px; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; }
.gr-kicker { font-size: 13px; font-weight: 700; letter-spacing: .4px; color: #9FC3EA; margin: 0 0 6px; }
.gr-hero h1 { font-size: clamp(24px, 4vw, 34px); font-weight: 800; margin: 0 0 8px; }
.gr-hero-lead { margin: 0; max-width: 620px; font-size: 14.5px; color: #D6E4F5; }
.gr-ref { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.25); border-radius: 12px; padding: 12px 16px; text-align: start; }
.gr-ref-label { display: block; font-size: 12px; color: #C9DCF2; }
.gr-ref-code { font-size: 18px; font-weight: 800; letter-spacing: 1px; }

/* Layout */
.gr-main { max-width: 960px; margin: -28px auto 0; padding: 0 16px 48px; }
.gr-form { display: grid; gap: 18px; }
.gr-card { background: #fff; border: 1px solid var(--gr-line); border-radius: 14px; padding: 22px; box-shadow: 0 6px 20px rgba(11,31,58,.05); }
.gr-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--gr-line); }
.gr-card-head h2 { font-size: 17px; font-weight: 800; margin: 0; }
.gr-num { width: 32px; height: 32px; border-radius: 9px; background: var(--gr-navy); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; }
.gr-note { font-size: 13px; color: var(--gr-muted); margin: 0 0 14px; }

.gr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.gr-span-2 { grid-column: 1 / -1; }
.gr-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gr-field > label { font-size: 13.5px; font-weight: 700; }
.gr-req { color: var(--gr-error); }
.gr-field input, .gr-field select {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--gr-line); border-radius: 10px;
  background: #fff; font: inherit; font-size: 14px; color: var(--gr-ink);
}
.gr-field select { appearance: auto; }
.gr-field input:focus, .gr-field select:focus, .dp-input:focus {
  outline: none; border-color: var(--gr-blue); box-shadow: 0 0 0 4px rgba(13,94,175,.12);
}
.gr-error { display: none; font-size: 12.5px; color: var(--gr-error); }
.gr-field.is-invalid input, .gr-field.is-invalid select, .gr-field.is-invalid .dp-input { border-color: var(--gr-error); background: var(--gr-error-soft); }
.gr-field.is-invalid .gr-error, .gr-upload.is-invalid .gr-error, .gr-check-wrap.is-invalid .gr-error { display: block; }
.gr-check-wrap.is-invalid { color: var(--gr-error); }

/* Date picker */
.dp { position: relative; }
.dp-row { display: flex; gap: 6px; align-items: stretch; }
.dp-input { flex: 1; min-width: 0; padding: 11px 13px; border: 1.5px solid var(--gr-line); border-radius: 10px; font: inherit; font-size: 14px; background: #fff; direction: ltr; text-align: right; }
.dp-open, .dp-mode { border: 1.5px solid var(--gr-line); border-radius: 10px; background: #fff; font: inherit; font-size: 13px; padding: 0 10px; cursor: pointer; color: var(--gr-ink); }
.dp-mode { font-weight: 700; color: var(--gr-blue); white-space: nowrap; }
.dp-pop { position: absolute; z-index: 50; top: calc(100% + 6px); inset-inline-start: 0; width: 300px; max-width: 92vw; background: #fff; border: 1px solid var(--gr-line); border-radius: 14px; box-shadow: 0 18px 40px rgba(11,31,58,.18); padding: 12px; }
.dp-head { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.dp-nav { width: 32px; height: 32px; border: 1px solid var(--gr-line); border-radius: 8px; background: #fff; cursor: pointer; font-size: 16px; }
.dp-title { flex: 1; display: flex; gap: 6px; }
.dp-month, .dp-year { font: inherit; font-size: 13px; padding: 5px 6px; border: 1px solid var(--gr-line); border-radius: 8px; background: #fff; min-width: 0; }
.dp-month { flex: 1.4; }
.dp-year { flex: 1; text-align: center; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dp-wd { text-align: center; font-size: 11.5px; font-weight: 700; color: var(--gr-muted); padding: 4px 0; }
.dp-day { border: 0; background: transparent; padding: 7px 0; border-radius: 8px; font: inherit; font-size: 13px; cursor: pointer; color: var(--gr-ink); }
.dp-day:hover { background: var(--gr-blue-soft); }
.dp-day.is-selected { background: var(--gr-blue); color: #fff; }
.dp-day:disabled { opacity: .3; cursor: default; }
.dp-empty { display: block; }
.dp-foot { display: flex; justify-content: space-between; gap: 6px; margin-top: 10px; border-top: 1px solid var(--gr-line); padding-top: 8px; }
.dp-foot button { border: 0; background: transparent; font: inherit; font-size: 13px; color: var(--gr-blue); cursor: pointer; font-weight: 700; }

/* Uploads */
.gr-uploads { display: grid; gap: 12px; }
.gr-upload { border: 1.5px dashed var(--gr-line); border-radius: 12px; padding: 14px 16px; background: #FBFCFE; }
.gr-upload.is-required { border-color: #B7CBE6; }
.gr-upload.is-invalid { border-color: var(--gr-error); background: var(--gr-error-soft); }
.gr-upload-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.gr-upload-title { font-weight: 800; font-size: 14px; }
.gr-upload-desc { margin: 4px 0 8px; font-size: 12.5px; color: var(--gr-muted); }
.gr-upload input[type="file"] { font: inherit; font-size: 13px; width: 100%; }
.gr-upload-result { margin-top: 6px; }
.gr-file-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--gr-ok); font-weight: 700; overflow-wrap: anywhere; }
.gr-badge { font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: #EEF2F7; color: var(--gr-muted); white-space: nowrap; }
.gr-badge--req { background: var(--gr-blue-soft); color: var(--gr-navy); }
.gr-link { border: 0; background: transparent; color: var(--gr-error); font: inherit; font-size: 12.5px; cursor: pointer; font-weight: 700; }

/* Declarations */
.gr-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; margin-bottom: 10px; }
.gr-check input { margin-top: 6px; width: 18px; height: 18px; flex-shrink: 0; }
.gr-check-wrap .gr-error { display: none; }
.gr-disclaimer { margin-top: 14px; background: var(--gr-blue-soft); border-inline-start: 4px solid var(--gr-blue); padding: 12px 14px; border-radius: 10px; font-size: 13px; color: var(--gr-navy); }

/* Actions */
.gr-actions { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.gr-status { margin: 0; font-size: 14px; font-weight: 700; color: var(--gr-muted); min-height: 1.6em; text-align: center; }
.gr-status.is-error { color: var(--gr-error); }
.gr-submit { border: 0; border-radius: 12px; background: var(--gr-navy); color: #fff; font: inherit; font-size: 16px; font-weight: 800; padding: 14px 20px; cursor: pointer; }
.gr-submit:hover { background: var(--gr-ink); }
.gr-submit:disabled { opacity: .6; cursor: default; }

/* Result */
.gr-result { margin-top: 18px; }
.gr-result-card { background: #fff; border: 1px solid var(--gr-line); border-radius: 16px; padding: 28px; text-align: center; box-shadow: 0 10px 30px rgba(11,31,58,.08); }
.gr-result-card h2 { font-size: 20px; font-weight: 800; margin: 0 0 6px; color: var(--gr-ok); }
.gr-barcode-wrap { margin: 18px auto 8px; max-width: 420px; }
.gr-barcode-wrap svg { width: 100%; height: auto; }
.gr-ref-big { font-size: 20px; font-weight: 800; letter-spacing: 1px; margin: 4px 0 18px; }
.gr-result-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.gr-btn { display: inline-flex; align-items: center; border-radius: 10px; padding: 11px 18px; background: var(--gr-navy); color: #fff; font: inherit; font-weight: 700; font-size: 14px; border: 0; cursor: pointer; text-decoration: none; }
.gr-btn--ghost { background: #fff; color: var(--gr-navy); border: 1.5px solid var(--gr-line); }

.gr-footer { text-align: center; font-size: 12.5px; color: var(--gr-muted); padding: 24px 16px 40px; }

@media (max-width: 640px) {
  .gr-grid { grid-template-columns: 1fr; }
  .gr-card { padding: 18px; }
  .dp-pop { inset-inline-start: 50%; transform: translateX(50%); }
}

/* Print: only the result card, so "Print / Save as PDF" produces a clean reference sheet. */
@media print {
  .gr-page > *:not(.gr-main) { display: none !important; }
  .gr-main > *:not(.gr-result) { display: none !important; }
  .gr-main { margin: 0; padding: 0; }
  .gr-result { margin: 0; }
  .gr-result-actions { display: none !important; }
  .gr-result-card { box-shadow: none; border: 0; }
  body { background: #fff; }
}

/* ---------- Print sheet (PDF): branded header, reference, barcode, tables, footer ---------- */
.gr-print-sheet { display: none; }
@media print {
  @page { size: A4; margin: 14mm 14mm 16mm; }
  body * { visibility: hidden !important; }
  .gr-print-sheet, .gr-print-sheet * { visibility: visible !important; }
  .gr-print-sheet {
    display: block !important; position: absolute; inset: 0; background: #fff; color: #0F172A;
    font-family: Vazirmatn, Tahoma, sans-serif; font-size: 12px; line-height: 1.8;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .ps-head {
    display: flex; justify-content: space-between; align-items: center; padding: 14px 18px;
    background: #0B1F3A; color: #fff; border-radius: 10px;
  }
  .ps-brand { display: flex; align-items: center; gap: 12px; }
  .ps-logo {
    width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
    background: #F59E0B; color: #0F172A; font-weight: 900;
  }
  .ps-brand strong { display: block; font-size: 15px; }
  .ps-brand small, .ps-ref small { display: block; opacity: .8; font-size: 11px; }
  .ps-ref { text-align: left; }
  .ps-ref strong { font-size: 16px; letter-spacing: .5px; }
  .gr-print-sheet .ps-title { font-size: 18px; margin: 16px 0 8px; color: #1E40AF; }
  .gr-print-sheet h2 {
    font-size: 13px; margin: 16px 0 6px; padding: 4px 10px; border-inline-start: 4px solid #14B8A6; background: #F0FDFA;
  }
  .ps-barcode { text-align: center; margin: 10px 0; }
  .ps-barcode svg { max-width: 260px; height: auto; }
  .ps-table { width: 100%; border-collapse: collapse; }
  .ps-table th, .ps-table td { border: 1px solid #E2E8F0; padding: 6px 10px; vertical-align: top; }
  .ps-table th { width: 38%; background: #F8FAFC; text-align: start; color: #334155; font-weight: 700; }
  .ps-foot {
    margin-top: 18px; padding-top: 8px; border-top: 2px solid #2563EB;
    display: flex; justify-content: space-between; gap: 12px; font-size: 10.5px; color: #475569;
  }
}
