/* ── Personal Information Form — Frontend Styles ── */
.pif-wrap {
  max-width: 760px;
  margin: 0 auto;
  font-family: 'Source Sans 3', 'Segoe UI', Arial, sans-serif;
  color: #1a1a1a;
  font-size: 14px;
  line-height: 1.55;
  padding: 0 16px;
  box-sizing: border-box;
}

.pif-title {
  font-size: 22px;
  color: #2c5f8a;
  margin-bottom: 10px;
  font-weight: 700;
  border-bottom: 3px solid #2c5f8a;
  padding-bottom: 10px;
}

.pif-intro {
  font-size: 13px;
  color: #555;
  font-style: italic;
  margin-bottom: 28px;
}

/* ── Question blocks ── */
.pif-q-block { margin-bottom: 22px; }

.pif-q-label {
  font-size: 13.5px;
  margin-bottom: 8px;
  display: block;
  font-weight: 500;
}

.pif-num {
  font-weight: 700;
  color: #2c5f8a;
  margin-right: 4px;
}

/* ── Medical table ── */
.pif-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0;
}

.pif-med-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 16px;
  font-size: 13px;
  min-width: 320px;
}

.pif-med-table thead th {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fff;
  background: #2c5f8a;
  padding: 8px 10px;
  text-align: center;
}

.pif-med-table thead th.col-condition { text-align: left; }

.pif-med-table tbody tr {
  border-bottom: 1px solid #e8e4de;
  transition: background .15s;
}

.pif-med-table tbody tr:hover { background: #f5f2ee; }

.pif-med-table td {
  padding: 8px 10px;
  vertical-align: middle;
}

.col-condition { font-size: 13px; min-width: 180px; }
.col-yn        { text-align: center; width: 52px; }
.col-specify   { min-width: 120px; }

/* ── Custom radio ── */
.pif-radio {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.pif-radio input[type="radio"] { display: none; }

.pif-dot {
  width: 18px;
  height: 18px;
  border: 2px solid #bbb;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  transition: border-color .2s;
  flex-shrink: 0;
}

.pif-radio input:checked + .pif-dot { border-color: #2c5f8a; }

.pif-radio input:checked + .pif-dot::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #2c5f8a;
}

/* ── Spec input ── */
.pif-spec-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid #ccc;
  background: transparent;
  font-size: 12.5px;
  padding: 3px 4px;
  outline: none;
  transition: border-color .2s;
  font-family: inherit;
  box-sizing: border-box;
}

.pif-spec-input:focus { border-bottom-color: #2c5f8a; }

/* ── Yes/No rows ── */
.pif-yn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  border-bottom: 1px solid #ece8e2;
  padding: 10px 0;
  gap: 10px;
  font-size: 13.5px;
}

.pif-yn-text {
  flex: 1;
  min-width: 180px;
  line-height: 1.5;
  padding-top: 2px;
}

.pif-yn-options {
  display: flex;
  gap: 20px;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 2px;
}

.pif-yn-label {
  font-size: 13px;
  color: #444;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px; /* bigger tap target */
  padding: 4px 0;
}

/* ── Sub field (how many times) ── */
.pif-sub-field {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding-left: 20px;
  font-size: 12.5px;
  color: #666;
  box-sizing: border-box;
}

.pif-sub-field input {
  width: 80px;
  border: none;
  border-bottom: 1px solid #ccc;
  background: transparent;
  font-size: 13px;
  padding: 2px 4px;
  outline: none;
  font-family: inherit;
}

.pif-sub-field input:focus { border-bottom-color: #2c5f8a; }

/* ── Text fields ── */
.pif-field-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #2c5f8a;
  margin-bottom: 6px;
}

.pif-input {
  width: 100%;
  border: none;
  border-bottom: 2px solid #ccc;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  color: #1a1a1a;
  padding: 8px 2px;
  outline: none;
  transition: border-color .2s;
  box-sizing: border-box;
  min-height: 44px;
}

.pif-input:focus { border-bottom-color: #2c5f8a; }

.pif-textarea {
  width: 100%;
  border: 2px solid #ccc;
  border-radius: 4px;
  background: transparent;
  font-family: inherit;
  font-size: 13.5px;
  padding: 8px 10px;
  resize: vertical;
  outline: none;
  transition: border-color .2s;
  min-height: 80px;
  box-sizing: border-box;
}

.pif-textarea:focus { border-color: #2c5f8a; }

/* ── Section header ── */
.pif-section-header {
  font-size: 14px;
  font-weight: 700;
  color: #2c5f8a;
  border-bottom: 2px solid #2c5f8a;
  padding-bottom: 6px;
  margin: 30px 0 14px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ── Emergency grid ── */
.pif-emergency-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
  margin-bottom: 24px;
}

.pif-field-full { grid-column: 1 / -1; }

/* ── Error ── */
.pif-error {
  background: #fff0f0;
  border: 1px solid #e55;
  border-radius: 4px;
  color: #c00;
  padding: 12px 16px;
  margin: 12px 0;
  font-size: 13px;
  line-height: 1.5;
}

/* ── Submit ── */
.pif-submit-wrap { text-align: center; margin-top: 32px; }

.pif-submit-btn {
  background: #2c5f8a;
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 15px 48px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .2s, transform .15s;
  width: 100%;
  max-width: 360px;
  min-height: 52px;
  touch-action: manipulation;
}

.pif-submit-btn:hover:not(:disabled) { background: #1e4470; transform: translateY(-1px); }
.pif-submit-btn:active:not(:disabled) { transform: translateY(0); }
.pif-submit-btn:disabled { opacity: .6; cursor: not-allowed; }

.pif-notice {
  font-size: 11.5px;
  color: #999;
  margin-top: 10px;
  font-style: italic;
}

/* ── Success / Thank-you ── */
.pif-success {
  text-align: center;
  padding: 60px 20px;
}

.pif-success-icon {
  width: 72px;
  height: 72px;
  background: #2c5f8a;
  color: #fff;
  border-radius: 50%;
  font-size: 36px;
  line-height: 72px;
  margin: 0 auto 20px;
}

.pif-success h3 { font-size: 24px; color: #2c5f8a; margin-bottom: 10px; }
.pif-success p  { color: #555; font-size: 14px; margin-bottom: 28px; }

/* Back-to-homepage button */
.pif-home-btn {
  display: inline-block;
  background: #2c5f8a;
  color: #fff !important;
  text-decoration: none !important;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 13px 36px;
  border-radius: 6px;
  transition: background .2s, transform .15s;
  touch-action: manipulation;
  min-height: 48px;
  line-height: 22px;
}

.pif-home-btn:hover  { background: #1e4470; transform: translateY(-1px); color: #fff !important; }
.pif-home-btn:active { transform: translateY(0); }

/* ── Responsive: tablet / small desktop ── */
@media (max-width: 600px) {
  .pif-wrap { padding: 0 12px; }
  .pif-title { font-size: 19px; }

  .pif-emergency-grid { grid-template-columns: 1fr; }
  .pif-field-full { grid-column: 1; }

  .pif-yn-text { min-width: 140px; }

  .pif-submit-btn {
    width: 100%;
    max-width: 100%;
    padding: 15px 20px;
    font-size: 14px;
  }

  .pif-success { padding: 40px 12px; }
  .pif-success h3 { font-size: 20px; }

  .pif-home-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    padding: 14px 20px;
  }
}

/* ── Responsive: phone — convert table to card layout ── */
@media (max-width: 480px) {
  .pif-med-table,
  .pif-med-table thead,
  .pif-med-table tbody,
  .pif-med-table th,
  .pif-med-table td,
  .pif-med-table tr { display: block; }

  .pif-med-table thead { display: none; }

  .pif-med-table tbody tr {
    background: #f9f7f5;
    border: 1px solid #e0dbd4;
    border-radius: 6px;
    margin-bottom: 10px;
    padding: 10px 12px;
  }

  .pif-med-table td { padding: 4px 0; border: none; }

  .col-condition {
    font-weight: 600;
    font-size: 13.5px;
    padding-bottom: 8px !important;
    min-width: unset;
  }

  /* Inline YES/NO on mobile using data-label */
  .col-yn {
    display: inline-flex !important;
    width: auto !important;
    align-items: center;
    gap: 4px;
    margin-right: 12px;
  }

  .col-yn::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #2c5f8a;
    margin-right: 4px;
  }

  .col-specify { display: block; width: 100%; margin-top: 6px; }

  .pif-yn-text { min-width: 100%; }
  .pif-yn-options { width: 100%; }
  .pif-sub-field { padding-left: 0; }

  .pif-yn-options { gap: 16px; }
}

@media (max-width: 360px) {
  .pif-wrap { padding: 0 8px; }
  .pif-yn-options { gap: 10px; }
}

/* ── Language toggle bar ── */
.pif-lang-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 18px;
}

.pif-lang-btn {
  background: #fff;
  border: 2px solid #2c5f8a;
  color: #2c5f8a;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 7px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: background .2s, color .2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
}

.pif-lang-btn:hover {
  background: #2c5f8a;
  color: #fff;
}
