/* =========================================================
   installer-cert.css  –  Installer certification form + certificate document
   ========================================================= */

/* ── Hero ── */
.ic-hero {
  padding-top: 6rem;
  padding-bottom: 3rem;
  background: var(--navy);
  text-align: center;
}
.ic-hero .section-title { color: #fff; }
.ic-hero .section-desc  { color: rgba(255,255,255,0.75); max-width: 560px; margin: 0 auto; }

/* ── Main section ── */
.ic-main-section { background: var(--light); }

/* ── Form grid ── */
.ic-form-wrap {
  max-width: 780px;
  margin: 0 auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 32px rgba(11,31,58,0.09);
  padding: 2.5rem 2.5rem 2rem;
}
.ic-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 2rem;
  margin-bottom: 1.75rem;
}
@media (max-width: 640px) {
  .ic-main-section .pp-inner { padding-left: 0.75rem; padding-right: 0.75rem; }
  .ic-form-wrap { padding: 1.5rem 1rem 1.5rem; }
  .ic-form-grid { grid-template-columns: 1fr; }
}

.ic-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.ic-field label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy);
}
.ic-field input {
  box-sizing: border-box;
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid #d1d9e6;
  border-radius: 8px;
  font-family: 'Heebo', sans-serif;
  font-size: 1rem;
  color: var(--text);
  background: #fff;
  text-align: right;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.ic-optional {
  font-weight: 400;
  color: #8a96aa;
  font-size: 0.8rem;
}
.ic-company-locked {
  background: #f3f5f8;
  color: #6b7280;
  cursor: not-allowed;
}
@keyframes ic-loading-border {
  0%   { border-color: #d1d9e6 #0b1f3a #d1d9e6 #d1d9e6; }
  25%  { border-color: #d1d9e6 #d1d9e6 #0b1f3a #d1d9e6; }
  50%  { border-color: #d1d9e6 #d1d9e6 #d1d9e6 #0b1f3a; }
  75%  { border-color: #0b1f3a #d1d9e6 #d1d9e6 #d1d9e6; }
  100% { border-color: #d1d9e6 #0b1f3a #d1d9e6 #d1d9e6; }
}
.ic-company-loading {
  background: #f3f5f8 !important;
  border-width: 2px !important;
  animation: ic-loading-border 1s infinite linear !important;
  color: transparent !important;
  cursor: wait !important;
  pointer-events: none;
}
.ic-company-hint {
  font-size: 0.78rem;
  color: #8a96aa;
  margin-top: 0.25rem;
}
.ic-field input[type="file"] {
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  color: var(--text);
}

/* ── Business type toggle ── */
.ic-field-full {
  grid-column: 1 / -1;
}
.ic-business-type-toggle {
  display: flex;
  gap: 2rem;
  align-items: center;
  padding: 0.5rem 0;
}
.ic-business-type-toggle label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
}
.ic-business-type-toggle input[type="radio"] {
  width: auto;
  accent-color: var(--navy);
  cursor: pointer;
}

/* ── HP / Osek field wrappers — each occupies one grid cell ── */
.ic-hp-fields-wrap,
.ic-osek-fields-wrap {
  display: contents;
}
.ic-hp-fields-wrap[hidden],
.ic-osek-fields-wrap[hidden] {
  display: none;
}
.ic-field select {
  box-sizing: border-box;
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid #d1d9e6;
  border-radius: 8px;
  font-family: 'Heebo', sans-serif;
  font-size: 1rem;
  color: var(--text);
  background: #fff;
  text-align: right;
  direction: rtl;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235a6a85' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 0.9rem center;
  padding-left: 2rem;
}
.ic-field select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.15);
}
.ic-field select.ic-field-error { border-color: #f87171; }

.ic-field input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.15);
}
.ic-field input.ic-field-error {
  border-color: #f87171;
}

/* ── YouTube confirmation checkbox ── */
.ic-youtube-confirm {
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
  background: #fff8f0;
  border: 1.5px solid #fcd49a;
  border-radius: 10px;
}
.ic-youtube-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--navy);
  font-weight: 500;
  line-height: 1.5;
}
.ic-youtube-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin-top: 2px;
  accent-color: var(--navy);
  cursor: pointer;
}
.ic-youtube-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #cc0000;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.ic-youtube-link:hover { text-decoration: underline; }
.ic-youtube-label input[type="checkbox"].ic-field-error {
  outline: 2px solid #f87171;
  outline-offset: 2px;
}

#ic-status {
  display: none;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}
#ic-status.ic-status-error { color: #f87171; display: block; }

.ic-submit-btn {
  display: block;
  margin: 0 auto;
  padding: 0.85rem 2.5rem;
  background: var(--gold);
  color: var(--navy);
  font-family: 'Heebo', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.ic-submit-btn:hover:not(:disabled) { background: var(--gold-light); transform: translateY(-2px); }
.ic-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Sent success banner ── */
.ic-sent-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  color: #15803d;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 10px;
  padding: 0.9rem 1.25rem;
  margin-bottom: 1.5rem;
  direction: rtl;
}
.ic-sent-banner svg { flex-shrink: 0; color: #16a34a; }
.ic-sent-banner[hidden] { display: none !important; }

/* ── Preview toolbar ── */
.ic-preview-toolbar {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.ic-print-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.8rem;
  background: var(--navy);
  color: #fff;
  font-family: 'Heebo', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}
.ic-print-btn:hover { background: var(--navy-mid); }
.ic-back-btn {
  background: transparent;
  border: 1.5px solid #d1d9e6;
  color: #5a6a85;
  font-family: 'Heebo', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.ic-back-btn:hover { border-color: var(--gold); color: var(--gold); }

/* ── Certificate document (on-screen) ── */
.ic-cert-wrapper {
  max-width: 794px;
  margin: 0 auto;
  box-shadow: 0 8px 48px rgba(11,31,58,0.12);
  border-radius: 8px;
  overflow-x: auto;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}
.ic-cert-doc {
  background: #fff;
  padding: 36px 44px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  color: #1a1a1a;
  direction: rtl;
  text-align: right;
  min-width: 680px;
}
.ic-cert-table { width: 100%; border-collapse: collapse; }
.ic-cert-header-cell {
  text-align: center;
  padding-bottom: 10px;
  border-bottom: 2px solid #1a1a1a;
}
.ic-cert-company-line { font-size: 12px; color: #333; }
.ic-cert-title-cell { text-align: center; padding: 14px 0 10px; }
.ic-cert-title {
  font-size: 15px;
  font-weight: 900;
  color: #000;
  line-height: 1.4;
  margin: 0;
  text-decoration: underline;
}
.ic-cert-body-cell { padding: 10px 0; }
.ic-cert-preamble { margin: 8px 0; font-size: 13px; line-height: 1.6; font-weight: 600; }
.ic-cert-field-row { margin: 5px 0; font-size: 13px; display: flex; gap: 2rem; flex-wrap: wrap; }
.ic-cert-field-label { font-weight: 600; white-space: nowrap; }
.ic-cert-field-value {
  font-weight: 700;
  border-bottom: 1px solid #333;
  min-width: 140px;
  display: inline-block;
  padding-bottom: 1px;
}
.ic-cert-topics-intro { font-size: 13px; line-height: 1.6; margin: 10px 0 6px; }
.ic-bullets-table { width: 100%; border-collapse: collapse; margin: 4px 0 12px; }
.ic-bullet-num  { width: 22px; vertical-align: top; font-weight: 700; padding: 2px 2px 2px 0; font-size: 12.5px; }
.ic-bullet-text { padding: 2px 4px; line-height: 1.6; font-size: 12.5px; vertical-align: top; }

/* Signature section label */
.ic-sig-label {
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  margin: 14px 0 4px;
}
.ic-sig-section-cell { padding: 8px 0; }
.ic-sig-table { width: 100%; border-collapse: collapse; font-size: 11.5px; margin-bottom: 4px; }
.ic-sig-table th,
.ic-sig-table td {
  border: 1px solid #888;
  padding: 6px 8px;
  text-align: center;
  vertical-align: middle;
}
.ic-sig-table th { background: #f0f0f0; font-weight: 700; }
.ic-sig-row-trainer td { color: #444; }
.ic-sig-row-trainee td { font-weight: 600; }
.ic-blank-sig { border-bottom: 1px solid #555 !important; color: transparent; user-select: none; }

.ic-validity-cell { padding: 10px 0 6px; }
.ic-validity-line { font-size: 13px; font-weight: 600; }

.ic-cert-footer-cell {
  padding-top: 14px;
  border-top: 1px solid #ccc;
  text-align: center;
  font-size: 11px;
  color: #555;
}
.ic-cert-disclaimer {
  font-size: 11.5px;
  color: #444;
  margin: 6px 0 2px;
  font-weight: 500;
}

/* ── Signature pad ── */
.ic-sig-pad-wrap {
  max-width: 794px;
  margin: 2rem auto 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(11,31,58,0.09);
  padding: 2rem 2rem 1.75rem;
  text-align: center;
}
.ic-sig-pad-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 0.3rem;
}
.ic-sig-pad-hint {
  font-size: 0.85rem;
  color: #6b7a99;
  margin: 0 0 1rem;
}
.ic-sig-pad-canvas-wrap {
  border: 2px dashed #c8d0e0;
  border-radius: 8px;
  background: #fafbfd;
  display: inline-block;
  width: 100%;
  max-width: 560px;
  touch-action: none;
}
#ic-sig-canvas {
  display: block;
  width: 100%;
  height: 160px;
  border-radius: 6px;
  cursor: crosshair;
}
.ic-sig-pad-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}
.ic-sig-status {
  margin-top: 0.9rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #16a34a;
}

/* ── Print ── */
@media print {
  @page { size: A4 portrait; margin: 15mm; }

  /* Hide everything outside the certificate */
  nav,
  .nav-mobile-menu,
  footer,
  .skip-link,
  .ic-hero,
  .ic-form-wrap,
  .ic-preview-toolbar,
  .ic-sig-pad-wrap,
  #ic-form-state { display: none !important; }

  /* Remove card chrome for print */
  .ic-sent-banner { display: none !important; }

  .ic-cert-wrapper {
    box-shadow: none !important;
    border-radius: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
  .ic-cert-doc {
    padding: 0 !important;
    background: #fff !important;
    color: #000 !important;
  }
  .ic-sig-section-cell { page-break-inside: avoid; }
  .ic-main-section { padding: 0 !important; background: #fff !important; }
  .pp-inner { padding: 0 !important; max-width: 100% !important; }
}
