:root {
  --page-bg: #f6f8fb;
  --white: #ffffff;
  --navy: #003a63;
  --navy-dark: #082033;
  --text: #102033;
  --muted: #586879;
  --light-muted: #7a8795;
  --border: #d8e0e8;
  --soft-border: #edf1f5;
  --accent: #006bb6;
  --accent-dark: #004f86;

  --success-bg: #edf8f0;
  --success-border: #a9d9b8;
  --success-text: #174c29;

  --error-bg: #fff3f3;
  --error-border: #ebb4b4;
  --error-text: #772222;

  --warn-bg: #fff9eb;
  --warn-border: #eed08b;
  --warn-text: #684b0c;

  --report-blue: #0b3f6f;
  --report-row: #f2f2f2;
  --report-border: #d9d9d9;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--page-bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
}

/* Header */

.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--soft-border);
}

.site-header-inner {
  width: min(1180px, calc(100% - 44px));
  margin: 0 auto;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--navy);
}

.site-logo-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  background: var(--navy);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 27px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -1px;
}

.site-logo-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: var(--navy);
  font-weight: 900;
  font-size: 17px;
  line-height: 0.94;
  letter-spacing: 4px;
}

.header-label {
  color: var(--navy);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

/* Main layout */

.main-shell {
  width: min(1120px, calc(100% - 44px));
  margin: 0 auto;
  padding: 40px 0 54px;
  flex: 1;
}

.hero-section {
  max-width: 860px;
  margin-bottom: 24px;
}

.hero-kicker {
  color: var(--accent);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  margin-bottom: 11px;
}

h1 {
  margin: 0;
  color: var(--navy-dark);
  font-size: clamp(38px, 4.6vw, 54px);
  line-height: 0.98;
  letter-spacing: -1.8px;
  font-weight: 900;
}

.hero-subtitle {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.35;
  font-weight: 600;
  max-width: 760px;
}

/* Search panel */

.search-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 0;
  box-shadow: 0 18px 50px rgba(8, 32, 51, 0.08);
  padding: 30px 34px;
  position: relative;
}

.search-panel::before {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  bottom: -1px;
  width: 8px;
  background: var(--navy);
}

.search-panel-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 25px;
  padding-left: 22px;
}

.search-panel-top h2 {
  margin: 0;
  color: var(--navy-dark);
  font-size: clamp(24px, 2.3vw, 32px);
  line-height: 1.06;
  letter-spacing: -0.8px;
  font-weight: 900;
}

.search-panel-top p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.format-badge {
  flex: 0 0 auto;
  background: #f0f5f9;
  border: 1px solid var(--border);
  color: var(--navy-dark);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
  white-space: nowrap;
}

.lookup-form {
  padding-left: 22px;
}

.lookup-form label {
  display: block;
  font-weight: 900;
  margin-bottom: 10px;
  color: var(--navy-dark);
  font-size: 14px;
  letter-spacing: 0.9px;
  text-transform: uppercase;
}

.input-row {
  display: flex;
  gap: 14px;
  align-items: stretch;
}

input {
  width: 230px;
  flex: 0 0 230px;
  border: 2px solid var(--border);
  border-radius: 0;
  padding: 18px;
  font-size: 20px;
  outline: none;
  text-transform: uppercase;
  color: var(--navy-dark);
  background: var(--white);
  letter-spacing: 0.5px;
  font-weight: 900;
}

input::placeholder {
  color: #7f8c99;
  opacity: 0.72;
  letter-spacing: 0;
  font-weight: 900;
}

input:focus {
  border-color: var(--accent);
}

button {
  border: 0;
  border-radius: 0;
  padding: 18px 34px;
  background: var(--accent);
  color: var(--white);
  font-weight: 900;
  font-size: 18px;
  cursor: pointer;
  white-space: nowrap;
  min-width: 150px;
  letter-spacing: 0.2px;
}

button:hover {
  background: var(--accent-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.help-text {
  color: var(--muted);
  font-size: 14px;
  margin: 12px 0 0;
  line-height: 1.45;
}

/* Results */

.result {
  margin-top: 34px;
  margin-left: 22px;
  border-radius: 0;
  padding: 20px;
  border: 1px solid var(--border);
}

.result.hidden {
  display: none;
}

.result.success {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-text);
}

.result.error {
  background: var(--error-bg);
  border-color: var(--error-border);
  color: var(--error-text);
}

.result.warn {
  background: var(--warn-bg);
  border-color: var(--warn-border);
  color: var(--warn-text);
}

.result-report {
  background: var(--white);
  border-color: var(--border);
  color: #000000;
}

.result-title {
  font-weight: 900;
  font-size: 20px;
  margin-bottom: 6px;
}

.result-detail {
  margin: 0;
  line-height: 1.45;
}

.cache-note {
  margin-top: 10px;
  font-size: 13px;
  opacity: 0.78;
}

/* WINDA report layout */

.winda-report {
  width: 100%;
  color: #000000;
  font-family: Arial, Helvetica, sans-serif;
}

.report-title {
  text-align: center;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.2px;
  margin: 4px 0 12px;
}

.report-meta {
  text-align: center;
  margin-bottom: 10px;
}

.report-meta-label {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1.15;
}

.report-name-label {
  margin-top: 8px;
}

.report-meta-value {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
}

.report-valid-line {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  margin: 8px 0 0;
}

/* Training records table */

.table-wrap {
  margin-top: 0;
  overflow-x: auto;
  border: 0;
  border-radius: 0;
  background: var(--white);
}

.records-table {
  width: 100%;
  min-width: 930px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
  color: #000000;
}

.records-table th {
  background: var(--report-blue);
  color: #ffffff;
  text-align: left;
  padding: 7px 10px;
  font-weight: 700;
  line-height: 1.1;
  border-right: 1px solid rgba(255, 255, 255, 0.55);
  border-bottom: 1px solid var(--report-blue);
  vertical-align: middle;
}

.records-table th:last-child {
  border-right: 0;
}

.records-table td {
  padding: 7px 10px;
  border-top: 1px solid var(--report-border);
  border-right: 1px solid var(--report-border);
  vertical-align: top;
  background: var(--white);
  line-height: 1.2;
  word-wrap: break-word;
}

.records-table td:last-child {
  border-right: 0;
}

.records-table tbody tr:nth-child(even) td {
  background: var(--report-row);
}

.records-table th:nth-child(1),
.records-table td:nth-child(1) {
  width: 17%;
}

.records-table th:nth-child(2),
.records-table td:nth-child(2) {
  width: 8%;
}

.records-table th:nth-child(3),
.records-table td:nth-child(3) {
  width: 34%;
}

.records-table th:nth-child(4),
.records-table td:nth-child(4) {
  width: 10%;
}

.records-table th:nth-child(5),
.records-table td:nth-child(5) {
  width: 10%;
}

.records-table th:nth-child(6),
.records-table td:nth-child(6) {
  width: 10%;
}

.records-table th:nth-child(7),
.records-table td:nth-child(7) {
  width: 11%;
}

.report-footer {
  margin-top: 12px;
  font-size: 12px;
  color: #333333;
  line-height: 1.35;
}

/* Email record panel */

.email-record-panel {
  margin-top: 28px;
  border: 1px solid var(--border);
  background: #f8fafc;
  padding: 22px;
  color: var(--text);
}

.email-record-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.email-record-intro h3 {
  margin: 0;
  font-size: 21px;
  line-height: 1.2;
  font-weight: 900;
  color: var(--navy-dark);
}

.email-record-intro p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 14px;
}

.secondary-action-button {
  border: 0;
  border-radius: 0;
  padding: 14px 22px;
  background: var(--accent);
  color: var(--white);
  font-weight: 900;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
  min-width: 230px;
}

.secondary-action-button:hover,
.secondary-action-button.active {
  background: var(--accent-dark);
}

.email-record-form {
  margin-top: 22px;
  border-top: 1px solid var(--border);
  padding-top: 22px;
  max-height: 900px;
  opacity: 1;
  overflow: hidden;
  transition:
    max-height 0.22s ease,
    opacity 0.18s ease,
    padding-top 0.18s ease,
    margin-top 0.18s ease;
}

.email-record-form.collapsed {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  margin-top: 0;
  border-top: 0;
  pointer-events: none;
}

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

.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

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

.form-field label {
  font-size: 13px;
  font-weight: 900;
  color: var(--navy-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-field label span {
  color: var(--light-muted);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.form-field input,
.form-field textarea {
  width: 100%;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--white);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  outline: none;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 700;
}

.form-field input {
  height: 46px;
  min-height: 46px;
  padding: 11px 14px;
  line-height: 1.2;
}

.form-field textarea {
  min-height: 86px;
  height: auto;
  padding: 13px 14px;
  line-height: 1.35;
  resize: vertical;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: #7f8c99;
  opacity: 0.72;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--accent);
}

.notify-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--border);
  cursor: pointer;
}

.notify-toggle input[type="checkbox"] {
  width: auto;
  height: auto;
  min-height: 0;
  flex: 0 0 auto;
  margin-top: 3px;
  padding: 0;
}

.notify-toggle span {
  display: block;
  color: var(--navy-dark);
  font-weight: 900;
  line-height: 1.35;
}

.notify-toggle small {
  display: block;
  color: var(--muted);
  font-weight: 600;
  margin-top: 4px;
  line-height: 1.4;
}

.notification-fields {
  margin-top: 16px;
  max-height: 240px;
  opacity: 1;
  overflow: hidden;
  transition:
    max-height 0.2s ease,
    opacity 0.18s ease,
    margin-top 0.18s ease;
}

.notification-fields.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}

.email-form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
}

.send-email-button {
  border: 0;
  border-radius: 0;
  padding: 15px 28px;
  background: var(--navy);
  color: var(--white);
  font-weight: 900;
  font-size: 16px;
  cursor: pointer;
  min-width: 150px;
}

.send-email-button:hover {
  background: #002b49;
}

.send-email-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.email-form-status {
  font-size: 14px;
  line-height: 1.4;
  font-weight: 700;
}

.email-form-status.success {
  color: var(--success-text);
}

.email-form-status.error {
  color: var(--error-text);
}

/* Verification note */

.verification-note {
  max-width: 900px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.verification-note p {
  margin: 0;
}

/* Footer */

.site-footer {
  background: var(--white);
  border-top: 1px solid var(--soft-border);
}

.site-footer-inner {
  width: min(1120px, calc(100% - 44px));
  margin: 0 auto;
  padding: 24px 0;
  color: var(--light-muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Taller screens - adds breathing room without enlarging fonts */

@media (min-height: 850px) {
  .main-shell {
    padding-top: 54px;
    padding-bottom: 70px;
  }

  .hero-section {
    margin-bottom: 34px;
  }

  .verification-note {
    margin-top: 30px;
  }
}

@media (min-height: 1000px) {
  .main-shell {
    padding-top: 70px;
    padding-bottom: 90px;
  }

  .hero-section {
    margin-bottom: 42px;
  }

  .verification-note {
    margin-top: 38px;
  }
}

/* Tablet/mobile */

@media (max-width: 860px) {
  .site-header-inner {
    width: min(100% - 28px, 1120px);
    min-height: 76px;
  }

  .site-logo-mark {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
    font-size: 26px;
  }

  .site-logo-text {
    font-size: 15px;
    letter-spacing: 3px;
  }

  .main-shell {
    width: min(100% - 28px, 1120px);
    padding: 44px 0 42px;
  }

  .hero-section {
    margin-bottom: 26px;
  }

  h1 {
    font-size: 42px;
    letter-spacing: -1.3px;
  }

  .hero-subtitle {
    font-size: 18px;
  }

  .search-panel {
    padding: 28px;
  }

  .search-panel-top {
    flex-direction: column;
    gap: 16px;
    padding-left: 18px;
    margin-bottom: 26px;
  }

  .lookup-form {
    padding-left: 18px;
  }

  .input-row {
    flex-direction: column;
  }

  input {
    width: 100%;
    flex-basis: auto;
  }

  button {
    width: 100%;
  }

  .result {
    margin-left: 18px;
  }

  .format-badge {
    white-space: normal;
  }

  .email-record-intro {
    flex-direction: column;
    align-items: stretch;
  }

  .secondary-action-button {
    width: 100%;
    min-width: 0;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .email-form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .send-email-button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .header-label {
    display: none;
  }

  .site-header-inner {
    width: min(100% - 24px, 1120px);
  }

  .site-logo-mark {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    font-size: 24px;
  }

  .site-logo-text {
    font-size: 13px;
    letter-spacing: 2px;
  }

  .main-shell {
    width: min(100% - 24px, 1120px);
    padding: 34px 0;
  }

  h1 {
    font-size: 36px;
    letter-spacing: -1px;
  }

  .hero-subtitle {
    font-size: 16px;
  }

  .search-panel {
    padding: 22px 18px 22px 20px;
  }

  .search-panel::before {
    width: 6px;
  }

  .search-panel-top,
  .lookup-form {
    padding-left: 14px;
  }

  .result {
    margin-left: 14px;
    padding: 16px;
  }

  .records-table {
    min-width: 900px;
    font-size: 11px;
  }

  .records-table th,
  .records-table td {
    padding: 6px 8px;
  }

  .footer-separator {
    display: none;
  }

  .site-footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}