:root {
  --ice-blue: #0896cf;
  --ice-blue-dark: #0576a5;
  --ice-orange: #ff8619;
  --ink: #102431;
  --muted: #667887;
  --line: #dbe7ee;
  --surface: #ffffff;
  --soft: #f3f8fb;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: var(--soft);
}

a {
  color: var(--ice-blue-dark);
  font-weight: 700;
  text-decoration: none;
}

a:hover {
  color: var(--ice-orange);
}

.form-control {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
}

.form-control:focus {
  border-color: var(--ice-blue);
  box-shadow: 0 0 0 4px rgba(8, 150, 207, 0.16);
}

.password-field {
  position: relative;
}

.password-field .form-control {
  padding-right: 76px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  min-width: 58px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  color: var(--ice-blue-dark);
  font-weight: 800;
  background: rgba(8, 150, 207, 0.1);
  transform: translateY(-50%);
}

.password-toggle:hover {
  color: #fff;
  background: var(--ice-blue);
}

.portal-page {
  min-height: 100vh;
}

.portal-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

.portal-header {
  background: #083449;
  color: #fff;
}

.portal-header__inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 800;
  min-width: 0;
}

.portal-brand span {
  max-width: min(56vw, 360px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-brand img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff;
  object-fit: cover;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 0.9fr);
  background: #fff;
}

.auth-visual {
  min-height: 100vh;
  padding: clamp(22px, 4vw, 46px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(6, 54, 77, 0.96), rgba(8, 150, 207, 0.9)),
    radial-gradient(circle at 76% 26%, rgba(255, 134, 25, 0.34), transparent 34%);
}

.auth-brandline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 2vw, 26px);
  max-width: 100%;
  text-align: left;
}

.auth-visual__logo {
  width: clamp(92px, 10vw, 132px);
  flex: 0 0 auto;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
  object-fit: cover;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.2);
}

.auth-brandline span {
  display: block;
  color: rgba(255, 255, 255, 0.84);
  font-size: clamp(1.05rem, 1.5vw, 1.45rem);
  font-weight: 850;
}

.auth-visual h1 {
  margin: 4px 0 0;
  font-size: clamp(2.1rem, 4vw, 4.3rem);
  line-height: 1;
  letter-spacing: 0;
}

.auth-panel,
.form-screen {
  min-height: 100vh;
  padding: 24px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(8, 150, 207, 0.08), rgba(255, 134, 25, 0.06)),
    #f8fbfd;
}

.auth-card,
.form-card {
  width: min(100%, 460px);
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid rgba(8, 150, 207, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 22px 60px rgba(12, 50, 68, 0.12);
}

.auth-wordmark {
  display: block;
  width: min(100%, 280px);
  height: 66px;
  margin-bottom: 30px;
  object-fit: contain;
  object-position: left center;
}

.auth-card__heading span {
  color: var(--ice-orange);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.auth-card__heading h2,
.form-card h1 {
  margin: 8px 0 18px;
  font-size: 2rem;
  line-height: 1.15;
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-form label {
  margin-top: 6px;
  color: #2a4150;
  font-weight: 750;
}

.auth-row {
  margin: 6px 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
}

.auth-submit {
  min-height: 50px;
  margin-top: 6px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-weight: 850;
  background: linear-gradient(135deg, var(--ice-blue), var(--ice-blue-dark));
  box-shadow: 0 14px 30px rgba(8, 150, 207, 0.28);
}

.auth-submit:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--ice-orange), #e26907);
}

.auth-footer {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
}

.validation-summary ul {
  margin-bottom: 0;
  padding-left: 18px;
}

.form-card {
  width: min(100%, 620px);
}

.form-card--compact {
  width: min(100%, 460px);
}

.form-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
}

.back-icon {
  width: 24px;
  height: 24px;
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--ice-blue-dark);
}

.back-icon::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 7px;
  width: 9px;
  height: 9px;
  border-left: 3px solid #fff;
  border-bottom: 3px solid #fff;
  transform: rotate(45deg);
}

.back-icon::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 11px;
  width: 11px;
  height: 3px;
  border-radius: 999px;
  background: #fff;
}

.form-logo {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  object-fit: cover;
}

.form-card p {
  margin: -10px 0 22px;
  color: var(--muted);
  line-height: 1.6;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.dashboard {
  padding: 24px 0;
}

.dashboard-alert {
  border: 0;
  border-radius: 8px;
  color: #084760;
  background: #dff5ff;
}

.dashboard-hero {
  min-height: 118px;
  padding: clamp(20px, 4vw, 30px);
  border-radius: 8px;
  display: grid;
  align-content: center;
  gap: 8px;
  color: #fff;
  background: linear-gradient(135deg, #083449, var(--ice-blue));
}

.dashboard-hero span {
  color: #ffd1a6;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dashboard-hero h1 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.6rem);
  line-height: 1.08;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.dashboard-grid .metric-card {
  position: relative;
  overflow: hidden;
  min-height: 106px;
  padding: 18px;
  border: 0;
  border-radius: 8px;
  display: block;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(16, 36, 49, 0.1);
}

.dashboard-grid .metric-card:hover {
  color: #fff;
  transform: translateY(-1px);
}

.dashboard-grid span,
.dashboard-grid strong {
  display: block;
}

.dashboard-grid span {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.95rem;
  font-weight: 750;
}

.dashboard-grid strong {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  color: #fff;
  font-size: clamp(1.55rem, 3.4vw, 2.2rem);
  line-height: 1;
}

.metric-card--blue {
  background: linear-gradient(135deg, #0789c1, #0db1da);
}

.metric-card--orange {
  background: linear-gradient(135deg, #f0711a, #ff9a22);
}

.metric-card--green {
  background: linear-gradient(135deg, #12805c, #22b17e);
}

.metric-card--ink {
  background: linear-gradient(135deg, #12364a, #23617c);
}

.metric-card--teal {
  background: linear-gradient(135deg, #087b8f, #10a7a7);
}

.metric-card--red {
  background: linear-gradient(135deg, #b53b49, #ec6262);
}

.metric-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.18);
}

.metric-watermark {
  position: absolute;
  right: -18px;
  bottom: -22px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  opacity: 0.12;
}

.dashboard-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.dashboard-links a {
  min-height: 88px;
  padding: 16px;
  border: 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  color: #fff;
  box-shadow: 0 14px 34px rgba(16, 36, 49, 0.12);
}

.dashboard-links a:hover {
  color: #fff;
  transform: translateY(-1px);
}

.resource-tile--website {
  background: linear-gradient(135deg, #083449, var(--ice-blue));
}

.resource-tile--video {
  background: linear-gradient(135deg, #c03945, var(--ice-orange));
}

.resource-tile--enquiry {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #127a5c, #19b985);
}

.resource-tile img,
.resource-play,
.youtube-logo {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.resource-play {
  color: #d3263a;
  font-size: 0.95rem;
  font-weight: 900;
}

.youtube-logo {
  border-radius: 14px;
}

.youtube-logo span {
  width: 32px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: #ff0033;
}

.youtube-logo span::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 10px solid #fff;
}

.resource-tile--enquiry .resource-play {
  color: #12805c;
  font-size: 1.7rem;
}

.resource-tile span:not(.resource-play) {
  min-width: 0;
}

.resource-tile strong,
.resource-tile small {
  display: block;
}

.resource-tile strong {
  color: #fff;
  font-size: 1.1rem;
  line-height: 1.15;
}

.resource-tile small {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.78);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.textarea-control {
  min-height: 110px;
  resize: vertical;
}

.policy-card {
  margin-top: 16px;
  border: 1px solid rgba(8, 150, 207, 0.16);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(16, 36, 49, 0.08);
}

.policy-card summary {
  min-height: 72px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.policy-card summary::-webkit-details-marker {
  display: none;
}

.policy-card summary::after {
  content: "+";
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  background: var(--ice-blue);
}

.policy-card details[open] summary::after {
  content: "-";
}

.policy-card summary span,
.policy-card summary small {
  display: block;
}

.policy-card summary span {
  font-weight: 900;
}

.policy-card summary small {
  margin-top: 3px;
  color: var(--muted);
}

.policy-content {
  max-height: 58vh;
  overflow: auto;
  padding: 0 18px 18px;
  color: #2a4150;
  line-height: 1.6;
}

.policy-content h2 {
  margin: 0 0 14px;
  font-size: 1.25rem;
}

.policy-content h3 {
  margin: 18px 0 8px;
  color: var(--ink);
  font-size: 1rem;
}

.policy-content p,
.policy-content ul {
  margin-bottom: 10px;
}

.policy-signature {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.detail-page {
  padding: 22px 0;
}

.detail-heading {
  margin-bottom: 14px;
}

.detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.detail-heading h1 {
  margin: 8px 0 0;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.detail-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.detail-title-row h1 {
  min-width: 0;
}

.detail-highlight {
  width: max-content;
  flex: 0 0 auto;
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, var(--ice-blue), var(--ice-blue-dark));
}

.export-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  font-weight: 850;
  background: linear-gradient(135deg, var(--ice-orange), #df6907);
  box-shadow: 0 10px 24px rgba(255, 134, 25, 0.24);
}

.pdf-icon {
  position: relative;
  width: 18px;
  height: 22px;
  display: block;
  border-radius: 3px;
  background: #fff;
}

.pdf-icon::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-top: 6px solid #ffcba3;
  border-left: 6px solid transparent;
}

.pdf-icon::after {
  content: "PDF";
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 4px;
  color: #df6907;
  font-size: 6px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.table-card {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(16, 36, 49, 0.08);
}

.portal-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

.portal-table th,
.portal-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.portal-table .numeric-cell {
  text-align: right;
}

.portal-table th {
  color: #fff;
  background: #083449;
  font-size: 0.9rem;
}

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

.empty-cell {
  color: var(--muted);
  text-align: center;
}

@media (max-width: 980px) {
  .auth-screen {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    min-height: auto;
    padding: 18px 20px;
    align-items: center;
    text-align: center;
  }

  .auth-brandline {
    gap: 14px;
  }

  .auth-visual__logo {
    width: 72px;
  }

  .auth-visual h1 {
    font-size: 2rem;
  }

  .auth-panel {
    min-height: auto;
    padding: 24px;
  }
}

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

  .auth-card,
  .form-card {
    padding: 20px;
  }

  .auth-wordmark {
    width: 230px;
    height: 54px;
  }

  .dashboard-hero {
    min-height: 96px;
    padding: 18px;
  }

  .dashboard {
    width: min(100% - 20px, 1160px);
    padding: 12px 0;
  }

  .dashboard-grid {
    gap: 8px;
    margin-top: 10px;
  }

  .dashboard-grid .metric-card {
    min-height: 86px;
    padding: 12px;
  }

  .dashboard-grid span {
    font-size: 0.82rem;
    line-height: 1.2;
  }

  .dashboard-grid strong {
    font-size: 1.42rem;
  }

  .metric-icon {
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    font-size: 0.92rem;
  }

  .metric-watermark {
    width: 72px;
    height: 72px;
  }

  .dashboard-links {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 10px;
  }

  .dashboard-links a {
    min-height: 70px;
    padding: 12px;
  }

  .resource-tile img,
  .resource-play,
  .youtube-logo {
    width: 42px;
    height: 42px;
  }

  .youtube-logo span {
    width: 27px;
    height: 19px;
  }

  .resource-tile strong {
    font-size: 1rem;
  }

  .resource-tile small {
    font-size: 0.8rem;
  }

  .detail-page {
    width: min(100% - 20px, 1160px);
    padding: 12px 0;
  }

  .detail-title-row {
    align-items: stretch;
    flex-direction: column;
  }

  .detail-highlight {
    width: 100%;
  }

  .portal-table th,
  .portal-table td {
    padding: 11px 12px;
    font-size: 0.9rem;
  }

  .policy-card {
    margin-top: 10px;
  }

  .policy-card summary {
    min-height: 60px;
    padding: 12px;
  }

  .policy-content {
    max-height: 52vh;
    padding: 0 12px 12px;
    font-size: 0.92rem;
  }
}

@media print {
  @page {
    size: A4;
    margin: 10mm;
  }

  .portal-header,
  .form-back,
  .export-btn,
  .dashboard-links,
  .policy-card {
    display: none !important;
  }

  html,
  body,
  .portal-page {
    min-height: auto !important;
    height: auto !important;
  }

  body {
    background: #fff;
  }

  main {
    display: block;
  }

  .detail-page {
    width: 100%;
    padding: 0;
    margin: 0;
  }

  .detail-heading {
    margin-bottom: 8px;
  }

  .detail-heading h1 {
    margin-top: 0;
    font-size: 1.35rem;
  }

  .detail-highlight {
    margin-top: 4px;
    padding: 5px 8px;
  }

  .table-card {
    overflow: visible;
    border-radius: 0;
    box-shadow: none;
  }

  .portal-table {
    min-width: 0;
  }

  .portal-table th,
  .portal-table td {
    padding: 8px 9px;
    font-size: 0.82rem;
  }
}
