/* Trainee Portal — evaluation form + certificate access */

/* Sticky footer: short pages still end with the footer flush to the
   bottom of the viewport. */
body.portal-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.portal-page main.portal-main {
  flex: 1 0 auto;
  min-height: 0;
}

.portal-footer {
  flex-shrink: 0;
}

.portal-linklike-danger {
  color: #B3362A;
}

/* Slim portal chrome (no site nav/footer on these pages) */
.portal-header {
  /* style.css makes bare <header> position:fixed (site nav behaviour) —
     opt out so the portal header sits in normal flow above the content. */
  position: static;
  background: #fff;
  border-bottom: 1px solid var(--sage, #B7D7C1);
}

.portal-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.portal-header img {
  height: 48px;
  width: auto;
  display: block;
}

.portal-header-tag {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--leaf-green, #2E7D5A);
  white-space: nowrap;
}

.portal-footer {
  position: static;
  background: #fff;
  border-top: 1px solid var(--sage, #B7D7C1);
  font-size: 0.85rem;
  color: var(--text-light, #52606D);
}

.portal-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.portal-footer a {
  color: var(--leaf-green, #2E7D5A);
  text-decoration: none;
  font-weight: 600;
}

.portal-footer a:hover {
  text-decoration: underline;
}


.portal-page main.portal-main {
  padding: 48px 0 80px;
  min-height: 60vh;
}

.portal-main .container-narrow {
  max-width: 860px;
}

.portal-head h1,
.portal-card h1 {
  font-size: 2.2rem;
  color: var(--deep-teal, #0F3D3A);
  margin: 0 0 6px;
}

.portal-sub {
  color: var(--text-light, #52606D);
  margin: 0 0 22px;
}

.portal-logout {
  font-size: 0.85rem;
  color: var(--leaf-green, #2E7D5A);
}

.portal-card {
  background: #fff;
  border: 1px solid var(--sage, #B7D7C1);
  border-radius: 16px;
  padding: 34px 36px;
  box-shadow: 0 6px 28px rgba(15, 61, 58, 0.06);
}

.portal-login-card {
  max-width: 540px;
  margin: 24px auto 0;
}

.portal-form label {
  display: block;
  font-weight: 600;
  color: var(--deep-teal, #0F3D3A);
  margin: 0 0 18px;
  font-size: 0.95rem;
}

.portal-form input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-dark, #1F2933);
  border: 1px solid var(--sage, #B7D7C1);
  border-radius: 10px;
  background: #FBFDFC;
}

.portal-form input:focus {
  outline: 2px solid var(--leaf-green, #2E7D5A);
  outline-offset: 1px;
  background: #fff;
}

.portal-submit {
  width: auto;
  padding: 13px 30px;
  font-size: 1rem;
}

.portal-help {
  margin: 22px 0 0;
  font-size: 0.85rem;
  color: var(--text-light, #52606D);
  line-height: 1.6;
}

/* Alerts */
.portal-alert {
  border-radius: 12px;
  padding: 14px 18px;
  margin: 0 0 20px;
  font-size: 0.95rem;
  line-height: 1.55;
}

.portal-alert-error {
  background: #FDF2F2;
  border: 1px solid #F1B8B4;
  color: #7A271A;
}

.portal-alert-success {
  background: #F2FAF5;
  border: 1px solid #C9E8D4;
  color: #1E5B41;
}

/* Session cards */
.portal-session-card {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  align-items: center;
  justify-content: space-between;
  padding: 26px 30px;
  margin-bottom: 18px;
}

.portal-session-card h2 {
  font-size: 1.25rem;
  color: var(--deep-teal, #0F3D3A);
  margin: 0 0 6px;
}

.portal-session-meta {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-light, #52606D);
}

.portal-session-id {
  font-size: 0.85rem;
  margin-top: 4px;
}

.portal-session-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.portal-badge {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.portal-badge-muted {
  background: #EEF2F1;
  color: #52606D;
}

.portal-badge-done {
  background: #F2FAF5;
  border: 1px solid #C9E8D4;
  color: #1E5B41;
}

.portal-resend-form {
  display: inline;
}

.portal-linklike {
  display: inline-block;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.88rem;
  color: var(--leaf-green, #2E7D5A);
  text-decoration: underline;
  cursor: pointer;
}

a.portal-linklike {
  text-decoration: underline;
}

/* Evaluation form */
.portal-autofill {
  background: #F2FAF5;
  border: 1px solid #C9E8D4;
  border-radius: 12px;
  padding: 6px 20px;
  margin: 0 0 26px;
}

.portal-autofill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  padding: 11px 0;
  border-bottom: 1px dashed #D4EADD;
  font-size: 0.95rem;
}

.portal-autofill-row:last-child {
  border-bottom: none;
}

.portal-autofill-row span {
  min-width: 120px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #52606D;
  padding-top: 3px;
}

.portal-autofill-row strong {
  color: var(--text-dark, #1F2933);
}

.portal-field {
  margin: 0 0 20px;
}

.portal-field label {
  display: block;
  font-weight: 600;
  color: var(--deep-teal, #0F3D3A);
  font-size: 0.95rem;
  margin-bottom: 7px;
}

.portal-hint {
  font-weight: 400;
  font-size: 0.82rem;
  color: var(--text-light, #52606D);
}

.portal-field input,
.portal-field textarea {
  display: block;
  width: 100%;
  padding: 11px 14px;
  font-size: 0.98rem;
  font-family: inherit;
  color: var(--text-dark, #1F2933);
  border: 1px solid var(--sage, #B7D7C1);
  border-radius: 10px;
  background: #FBFDFC;
}

.portal-field textarea {
  resize: vertical;
}

.portal-field input:focus,
.portal-field textarea:focus {
  outline: 2px solid var(--leaf-green, #2E7D5A);
  outline-offset: 1px;
  background: #fff;
}

.portal-field-certname input {
  font-size: 1.05rem;
}

.portal-eval-part {
  border: none;
  border-top: 2px solid var(--sage, #B7D7C1);
  margin: 26px 0 0;
  padding: 18px 0 0;
}

.portal-eval-part legend {
  /* display:block keeps the legend in normal flow — floating it (the old
     heading trick) collapses the fieldset content to zero width and pushes
     the rating grids off-screen. */
  display: block;
  width: 100%;
  box-sizing: border-box;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--deep-teal, #0F3D3A);
  padding: 0;
  margin: 0 0 10px;
}

.portal-scale-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #52606D;
  padding: 0 0 6px;
}

.portal-scale-nums {
  display: grid;
  grid-template-columns: repeat(5, 40px);
  gap: 4px;
  text-align: center;
}

.portal-rating-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid #EDF3F0;
}

.portal-rating-label {
  font-size: 0.95rem;
  color: var(--text-dark, #1F2933);
  line-height: 1.5;
  flex: 1;
}

.portal-rating-opts {
  display: grid;
  grid-template-columns: repeat(5, 40px);
  gap: 4px;
  flex: none;
}

.portal-rating-opt {
  position: relative;
  display: block;
}

.portal-rating-opt input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.portal-rating-opt span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  border: 1px solid var(--sage, #B7D7C1);
  border-radius: 8px;
  background: #FBFDFC;
  font-weight: 600;
  color: var(--text-light, #52606D);
  transition: background 0.15s ease, color 0.15s ease;
}

.portal-rating-opt:hover span {
  border-color: var(--leaf-green, #2E7D5A);
  color: var(--leaf-green, #2E7D5A);
}

.portal-rating-opt input:checked + span {
  background: var(--leaf-green, #2E7D5A);
  border-color: var(--leaf-green, #2E7D5A);
  color: #fff;
}

.portal-rating-opt input:focus-visible + span {
  outline: 2px solid var(--deep-teal, #0F3D3A);
  outline-offset: 1px;
}

.portal-scale-note {
  margin: 10px 0 0;
  font-size: 0.8rem;
  color: var(--text-light, #52606D);
}

.portal-submit-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 30px;
  flex-wrap: wrap;
}

/* Master admin — training records */
.portal-admin-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.portal-admin-filter select {
  padding: 9px 12px;
  font: inherit;
  color: var(--text-dark, #1F2933);
  border: 1px solid var(--sage, #B7D7C1);
  border-radius: 10px;
  background: #fff;
}

.portal-record {
  margin-bottom: 14px;
  padding: 0;
}

.portal-record summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 16px;
  padding: 20px 26px;
  cursor: pointer;
  list-style: none;
}

.portal-record summary::-webkit-details-marker {
  display: none;
}

.portal-record summary::after {
  content: '+';
  margin-left: auto;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--leaf-green, #2E7D5A);
}

.portal-record[open] summary::after {
  content: '–';
}

.portal-record-name {
  font-weight: 700;
  color: var(--deep-teal, #0F3D3A);
  font-size: 1.05rem;
}

.portal-record-meta {
  color: var(--text-light, #52606D);
  font-size: 0.88rem;
}

.portal-record-body {
  padding: 4px 26px 24px;
  border-top: 1px solid #EDF3F0;
}

.portal-record-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 14px 0 6px;
}

.portal-record-table td {
  padding: 7px 0;
  border-bottom: 1px solid #EDF3F0;
  color: var(--text-dark, #1F2933);
  vertical-align: top;
}

.portal-record-table td.portal-record-part {
  font-weight: 700;
  color: var(--deep-teal, #0F3D3A);
  padding-top: 16px;
  border-bottom: 1px solid var(--sage, #B7D7C1);
}

.portal-record-score {
  text-align: right;
  font-weight: 700;
  color: var(--leaf-green, #2E7D5A);
  white-space: nowrap;
  width: 56px;
}

.portal-record-openitem {
  font-size: 0.94rem;
  margin: 12px 0;
  color: var(--text-dark, #1F2933);
}

.portal-record-openitem span {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #52606D;
  margin-bottom: 3px;
}

.portal-admin-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.portal-admin-list li {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid #EDF3F0;
  font-weight: 600;
  color: var(--deep-teal, #0F3D3A);
}

/* Mobile */
@media (max-width: 720px) {
  .portal-card {
    padding: 24px 20px;
  }

  .portal-session-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .portal-rating-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .portal-rating-opts,
  .portal-scale-nums {
    grid-template-columns: repeat(5, minmax(44px, 1fr));
    width: 100%;
  }

  .portal-scale-head span:first-child {
    display: none;
  }
}

/* Admin — registrations section */
.portal-form select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--sage, #B7D7C1);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  color: var(--text-dark, #1F2933);
  margin-top: 6px;
}

.portal-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 18px;
}

.portal-hint-inline {
  font-weight: 400;
  font-size: 0.78rem;
  color: #64748B;
  font-style: normal;
}

.portal-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 500 !important;
  font-size: 0.92rem !important;
  color: var(--text-dark, #1F2933) !important;
}

.portal-check input {
  margin-top: 3px;
  width: auto;
}

.portal-reg-scroll {
  overflow-x: auto;
  margin-top: 14px;
}

.portal-reg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.portal-reg-table th {
  text-align: left;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #52606D;
  padding: 8px 10px;
  border-bottom: 2px solid #E2E8F0;
  white-space: nowrap;
}

.portal-reg-table td {
  padding: 10px;
  border-bottom: 1px solid #EEF2F6;
  vertical-align: top;
}

.portal-reg-table tr:last-child td {
  border-bottom: 0;
}

.portal-reg-num {
  font-weight: 700;
  color: var(--deep-teal, #0F3D3A);
  white-space: nowrap;
}

.portal-reg-meta-line {
  display: block;
  font-size: 0.78rem;
  color: #64748B;
}

@media (max-width: 720px) {
  .portal-form-grid {
    grid-template-columns: 1fr;
  }
}

/* Counselor portal login — standalone card (no header/footer chrome) */
.portal-login-logo {
  display: block;
  margin: 0 auto 6px;
  max-width: 190px;
  height: auto;
}

.portal-admin-page .portal-login-card {
  margin-top: 10vh;
}

.portal-admin-page .portal-login-card h1 {
  letter-spacing: 0.06em;
  font-size: 1.45rem;
}
