/* IELTS-adjacent portal. Loaded only on ielts / account / checkout — not on www. */

.portal {
  --portal-bg: #eef0f3;
  --portal-ink: #1a1a1a;
  --portal-muted: #5b616a;
  --portal-line: #d5dbe3;
  --portal-card: #ffffff;
  --portal-header: #161616;
  --portal-red: #9d1230;
  --portal-red-dark: #7a0e25;
  --focus: var(--portal-red);
  background: var(--portal-bg);
  color: var(--portal-ink);
  font-family: "Source Sans 3", "Noto Sans SC", sans-serif;
}

.portal a {
  color: var(--portal-red);
}

.portal a:hover {
  color: var(--portal-red-dark);
}

.portal-bar {
  background: var(--portal-header);
  color: #f3f3f3;
  border-bottom: 3px solid var(--portal-red);
}

.portal-bar .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0;
}

.portal-bar .wordmark {
  color: #fff;
}

.portal-bar .wordmark:hover {
  color: #fff;
}

.portal-bar .wordmark .tld {
  color: #9a9a9a;
}

.portal-bar nav a {
  color: #d8d8d8;
  text-decoration: none;
  font-size: 0.9rem;
}

.portal-bar nav a:hover,
.portal-bar nav a[aria-current="page"] {
  color: #fff;
  text-decoration: none;
}

.portal-bar .lang-toggle {
  color: #bdbdbd;
}

.portal-bar .lang-toggle:hover,
.portal-bar .lang:hover .lang-toggle,
.portal-bar .lang:focus-within .lang-toggle {
  color: #fff;
}

.portal-bar .lang-menu {
  background: #fff;
  color: var(--portal-ink);
}

.session-chip {
  display: none;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: #cfcfcf;
}

.portal[data-authed="true"] .session-chip {
  display: flex;
}

.portal[data-authed="true"] .guest-links {
  display: none;
}

.session-chip button,
.session-chip a {
  appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.portal-tabs {
  background: #fff;
  border-bottom: 1px solid var(--portal-line);
}

.portal-tabs .wrap {
  display: flex;
  gap: 0;
}

.portal-tabs a {
  padding: 0.7rem 1rem;
  color: var(--portal-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.portal-tabs a:hover {
  color: var(--portal-ink);
}

.dash-hello {
  margin-bottom: 1.5rem;
}

.dash-hello .lede {
  margin-bottom: 0;
  font-size: 1rem;
}

.dash-grid {
  display: grid;
  gap: 0.75rem;
  margin: 0 0 2rem;
}

@media (min-width: 720px) {
  .dash-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.dash-card {
  display: block;
  padding: 1.1rem 1.15rem;
  background: #fff;
  border: 1px solid var(--portal-line);
  color: var(--portal-ink);
  text-decoration: none;
}

.dash-card:hover {
  border-color: var(--portal-red);
  color: var(--portal-ink);
}

.dash-card strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 1rem;
}

.dash-card span {
  color: var(--portal-muted);
  font-size: 0.9rem;
}

.dash-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin: 0 0 0.65rem;
}

.dash-head h2 {
  margin: 0;
}

.dash-head a {
  font-size: 0.9rem;
}

.portal main {
  padding: 1.5rem 0 3.5rem;
}

.portal h1,
.portal h2 {
  font-family: "Source Sans 3", "Noto Sans SC", sans-serif;
  letter-spacing: 0;
  font-weight: 600;
}

.portal h1 {
  font-size: 1.45rem;
  margin: 0 0 0.5rem;
}

.panel {
  background: var(--portal-card);
  border: 1px solid var(--portal-line);
  padding: 1.35rem 1.4rem 1.5rem;
  max-width: 46rem;
}

.panel > p:last-child {
  margin-bottom: 0;
}

.panel-lede {
  color: var(--portal-muted);
  font-size: 0.95rem;
  max-width: 40rem;
}

.portal .btn {
  background: var(--portal-red);
  border-color: var(--portal-red);
  color: #fff;
  border-radius: 2px;
  font-weight: 600;
}

.portal .btn:hover {
  background: var(--portal-red-dark);
  border-color: var(--portal-red-dark);
  color: #fff;
}

.portal .btn-secondary {
  background: #fff;
  border-color: #8b9098;
  color: var(--portal-ink);
}

.portal .btn-secondary:hover {
  background: var(--portal-ink);
  color: #fff;
}

.portal label {
  font-weight: 600;
  font-size: 0.875rem;
}

.portal .field :is(input, select, textarea):not([type="checkbox"]):not([type="hidden"]):not([type="radio"]) {
  width: 100%;
  height: 2.6rem;
  padding: 0 0.65rem;
  border: 1px solid #8b9098;
  border-radius: 2px;
  background: #fff;
  color: var(--portal-ink);
  font: inherit;
  font-size: 1rem;
}

.portal .field textarea {
  height: auto;
  min-height: 4.4rem;
  padding: 0.5rem 0.65rem;
}

.portal .field :is(input, select, textarea):focus {
  outline: 2px solid var(--portal-red);
  outline-offset: 0;
  border-color: var(--portal-red);
}

.phone-row {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: 0.5rem;
}

.req {
  color: var(--portal-red);
  font-weight: 600;
}

.status-pending { color: #8a5a00; }
.status-approved { color: #0f6b4c; }
.status-rejected { color: #9b1c1c; }

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  white-space: nowrap;
}

.admin-actions .btn {
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
}

.form-grid {
  display: grid;
  gap: 1rem 1.25rem;
}

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

.form-grid .field.span-2 {
  grid-column: 1 / -1;
}

.auth-shell {
  min-height: calc(100vh - 8rem);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2.5rem 0 4rem;
}

.auth-card {
  width: min(26.5rem, 100%);
  background: #fff;
  border: 1px solid var(--portal-line);
  padding: 1.6rem 1.5rem 1.7rem;
}

.auth-card h1 {
  margin-bottom: 0.35rem;
}

.auth-card .panel-lede {
  margin-bottom: 1.25rem;
}

.auth-card.wide {
  width: min(46rem, 100%);
}

.auth-extra {
  margin-top: 1.1rem;
  font-size: 0.9rem;
}

.form-section {
  margin: 1.35rem 0 0;
  padding-top: 1.15rem;
  border-top: 1px solid var(--portal-line);
}

.form-section > h2 {
  font-size: 0.95rem;
  margin: 0 0 0.85rem;
}

.portal textarea {
  width: 100%;
  min-height: 4.4rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid #8b9098;
  border-radius: 2px;
  background: #fff;
  color: var(--portal-ink);
  font: inherit;
  resize: vertical;
}

.portal textarea:focus {
  outline: 2px solid var(--portal-red);
  outline-offset: 0;
  border-color: var(--portal-red);
}

.service-pick {
  display: grid;
  gap: 0.65rem;
  margin: 0 0 1.25rem;
  padding: 0;
  border: 0;
}

@media (min-width: 640px) {
  .service-pick {
    grid-template-columns: 1fr 1fr;
  }
}

.service-pick legend {
  padding: 0;
  margin: 0 0 0.55rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.pick {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  margin: 0;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--portal-line);
  background: #fff;
  font-weight: 400;
  cursor: pointer;
}

.pick:has(input:checked) {
  border-color: var(--portal-red);
}

.pick input {
  margin-top: 0.2rem;
}

.pick strong {
  display: block;
  font-size: 0.95rem;
  color: var(--portal-ink);
}

.pick span {
  display: block;
  color: var(--portal-muted);
  font-size: 0.8rem;
  font-weight: 400;
}

.panel.wide {
  max-width: 46rem;
}

.result-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.trf-doc {
  background: #fff;
  border: 1px solid #bfc5cd;
  max-width: 48rem;
}

.trf-doc-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 1.15rem;
  border-bottom: 3px solid var(--portal-red);
}

.trf-doc-head h1 {
  margin: 0;
  font-size: 1.05rem;
}

.trf-doc-head p {
  margin: 0.2rem 0 0;
  color: var(--portal-muted);
  font-size: 0.8rem;
}

.trf-stamp {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--portal-red);
  border: 1px solid var(--portal-red);
  padding: 0.2rem 0.4rem;
  white-space: nowrap;
}

.trf-body {
  display: grid;
  gap: 1rem;
  padding: 1.1rem 1.15rem 1.2rem;
}

@media (min-width: 720px) {
  .trf-body {
    grid-template-columns: 1fr 7.5rem;
  }
}

.trf-photo {
  width: 7.5rem;
  height: 9.2rem;
  border: 1px solid var(--portal-line);
  background: #f3f4f6;
  color: #8a9099;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.5rem;
}

.portal .meta-table {
  max-width: none;
}

.portal .meta-table th {
  width: 12rem;
  color: var(--portal-muted);
  font-size: 0.8rem;
}

.trf-scores {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--portal-line);
}

.trf-scores div {
  padding: 0.65rem 0.5rem;
  text-align: center;
  border-right: 1px solid var(--portal-line);
}

.trf-scores div:last-child {
  border-right: 0;
}

.trf-scores span {
  display: block;
  font-size: 0.7rem;
  color: var(--portal-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.trf-scores strong {
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}

.trf-overall {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 0.85rem;
  padding: 0.7rem 0.85rem;
  background: #f7f8fa;
  border: 1px solid var(--portal-line);
}

.trf-overall span {
  font-size: 0.8rem;
  font-weight: 600;
}

.trf-overall strong {
  font-size: 1.6rem;
  font-variant-numeric: tabular-nums;
}

.portal-error {
  border: 1px solid var(--portal-line);
  border-left: 4px solid var(--portal-red);
  padding: 0.85rem 1rem;
  background: #fff;
  max-width: 46rem;
  margin: 0 0 1rem;
}

.portal-error strong {
  display: block;
  margin-bottom: 0.35rem;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: #fff;
  border: 1px solid var(--portal-line);
}

.history-table th,
.history-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--portal-line);
  text-align: left;
}

.history-table th {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--portal-muted);
  background: #f7f8fa;
}

.table-scroll {
  overflow-x: auto;
  margin-bottom: 2rem;
}

.admin-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: end;
  margin: 0 0 1rem;
}

.admin-filters .field {
  margin: 0;
  min-width: 12rem;
}

.admin-filters .field.grow {
  flex: 1;
  min-width: 16rem;
}

.stat-grid {
  display: grid;
  gap: 0.75rem;
  margin: 0 0 1.75rem;
}

@media (min-width: 720px) {
  .stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.stat-card {
  background: #fff;
  border: 1px solid var(--portal-line);
  padding: 1rem 1.1rem;
}

.stat-card strong {
  display: block;
  font-size: 1.6rem;
  font-variant-numeric: tabular-nums;
}

.stat-card span {
  color: var(--portal-muted);
  font-size: 0.85rem;
}

.pending-list {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 720px) {
  .pending-list {
    grid-template-columns: 1fr 1fr;
  }
}

.portal .notice {
  max-width: none;
  background: #fff8ec;
  border: 1px solid #e0c48a;
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
}

.portal .notice p {
  margin: 0.35rem 0 0;
  color: var(--portal-muted);
  font-weight: 400;
}

.mail-card {
  background: #fff;
  border: 1px solid var(--portal-line);
  padding: 1rem 1.1rem;
  margin: 0 0 1.25rem;
}

.mail-card p {
  margin: 0.35rem 0 0;
  word-break: break-all;
}

.mail-card a {
  color: var(--portal-red);
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.85rem 0 0;
  font-weight: 400;
}

.check-row input {
  margin-top: 0.25rem;
}

.invite-send {
  display: grid;
  gap: 0.75rem 1rem;
  align-items: end;
  margin: 0 0 1.25rem;
}

@media (min-width: 720px) {
  .invite-send {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

.invite-send .check-row {
  grid-column: 1 / -1;
}

.portal .site-footer {
  color: var(--portal-muted);
}

.portal .site-footer a {
  color: var(--portal-muted);
}

@media (max-width: 640px) {
  .trf-scores {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trf-scores div {
    border-bottom: 1px solid var(--portal-line);
  }
}
