:root {
  --navy: #041638;
  --navy-2: #08245a;
  --navy-3: #0d347a;
  --teal: #03afa9;
  --gold: #caa64b;
  --gold-soft: #f5edd8;
  --surface: #ffffff;
  --surface-soft: #f7faff;
  --line: #c8d4e6;
  --muted: #6f7d95;
  --text: #102033;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(3, 175, 169, 0.16), transparent 30%),
    linear-gradient(135deg, rgba(4, 22, 56, 0.96), rgba(8, 36, 90, 0.94)),
    #041638;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

h1,
h2,
p {
  margin: 0;
}

p {
  color: var(--muted);
  line-height: 1.55;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 7px;
  padding: 12px 16px;
  color: #ffffff;
  background: var(--navy-2);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
  background: var(--navy);
  box-shadow: 0 8px 18px rgba(4, 22, 56, 0.18);
  transform: translateY(-1px);
}

.secondary {
  color: var(--navy);
  background: #eef3fb;
  border: 1px solid var(--line);
}

.secondary:hover {
  background: #dde8f7;
}

.hidden {
  display: none !important;
}

body.portal-active #loginView {
  display: none !important;
}

body.portal-active #portalView {
  display: block !important;
}

body.login-active #loginView {
  display: block !important;
}

body.login-active #portalView {
  display: none !important;
}

.eyebrow {
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.login-panel {
  width: min(470px, 100%);
  padding: 36px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-top: 7px solid var(--gold);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(0, 8, 28, 0.38);
}

.login-logo-wrap {
  display: flex;
  justify-content: center;
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.brand-logo {
  width: min(340px, 90%);
  height: auto;
  object-fit: contain;
}

.login-copy {
  text-align: center;
}

.login-copy h1 {
  margin-top: 6px;
  color: var(--navy);
  font-size: 27px;
  letter-spacing: 0;
}

.login-copy p {
  margin-top: 10px;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 800;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 13px 12px;
  color: var(--navy);
  background: var(--surface-soft);
  font-size: 15px;
  outline: none;
}

input:focus {
  border-color: var(--navy-3);
  box-shadow: 0 0 0 3px rgba(13, 52, 122, 0.14);
}

.message {
  min-height: 18px;
  color: var(--danger);
  font-size: 13px;
}

.portal {
  width: min(1160px, 100%);
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: #f8fbff;
  box-shadow: 0 28px 80px rgba(0, 8, 28, 0.36);
}

.topbar {
  position: sticky;
  top: 14px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 88px;
  padding: 14px 16px 14px 270px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(4, 22, 56, 0.10);
  overflow: visible;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.topbar-logo {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  flex: none;
  width: 245px;
  height: 128px;
  object-fit: contain;
  background: transparent;
  z-index: 2;
}

.topbar-search {
  flex: 1;
  min-width: 220px;
  max-width: 430px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.support-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--navy-2), var(--navy-3));
}

.topbar-brand strong,
.topbar-brand span {
  display: block;
}

.topbar-brand strong {
  color: var(--navy);
  font-size: 19px;
}

.topbar-brand span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.hero-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  margin-top: 18px;
  padding: 30px;
  border-radius: 10px;
  color: #ffffff;
  background:
    radial-gradient(circle at top right, rgba(3, 175, 169, 0.20), transparent 28%),
    linear-gradient(135deg, rgba(4, 22, 56, 0.98), rgba(13, 52, 122, 0.95)),
    var(--navy);
}

.hero-copy {
  min-width: 0;
}

.hero-panel h1 {
  margin-top: 7px;
  color: #ffffff;
  font-size: 32px;
  letter-spacing: 0;
}

.hero-panel p {
  max-width: 690px;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.80);
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.hero-tags span {
  display: inline-flex;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 700;
}

.hero-badge {
  min-width: 160px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  text-align: center;
  background: rgba(255, 255, 255, 0.11);
}

.hero-badge strong {
  display: block;
  color: #ffffff;
  font-size: 42px;
  line-height: 1;
}

.hero-badge span {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
}

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

.summary-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #ffffff;
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.summary-card strong {
  display: block;
  margin-top: 5px;
  color: var(--navy);
  font-size: 17px;
}

.summary-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.readiness-card {
  border-color: rgba(3, 175, 169, 0.35);
  background: linear-gradient(180deg, #ffffff, #f4fbfb);
}

.readiness-card strong {
  font-size: 24px;
}

.readiness-track {
  width: 100%;
  height: 9px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6edf7;
}

.readiness-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--navy-3));
  transition: width 0.25s ease;
}

.library-panel {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.library-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.library-header h2 {
  color: var(--navy);
  font-size: 22px;
}

.library-header p {
  margin-top: 5px;
}

.guidance-strip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid #eadbb4;
  border-radius: 8px;
  background: var(--gold-soft);
}

.guidance-strip span {
  flex: none;
  padding: 4px 8px;
  border-radius: 999px;
  color: #5e4612;
  background: #ffffff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.guidance-strip p {
  color: #5e4612;
  font-size: 13px;
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.file-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--navy-3);
  border-radius: 9px;
  background: var(--surface-soft);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.file-card:hover {
  border-color: var(--navy-3);
  box-shadow: 0 12px 26px rgba(4, 22, 56, 0.10);
  transform: translateY(-2px);
}

.file-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.file-type {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--navy);
  background: #eaf1fb;
  font-size: 11px;
  font-weight: 800;
}

.file-card h3 {
  margin: 0;
  color: var(--navy);
  font-size: 15px;
  line-height: 1.38;
  overflow-wrap: anywhere;
  word-break: normal;
  white-space: normal;
}

.file-meta {
  color: var(--muted);
  font-size: 12px;
}

.file-actions {
  display: flex;
  gap: 8px;
}

.file-actions a {
  flex: 1;
  padding: 10px;
  border-radius: 7px;
  text-align: center;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.open-link {
  color: #ffffff;
  background: var(--navy-2);
}

.download-link {
  color: var(--navy);
  background: #edf3fb;
  border: 1px solid var(--line);
}

.open-link:hover,
.download-link:hover {
  filter: brightness(0.96);
}

.empty {
  margin-top: 16px;
  padding: 30px;
  border: 1px dashed var(--line);
  border-radius: 9px;
  color: var(--muted);
  text-align: center;
  background: #fbfdff;
}

@media (max-width: 760px) {
  .app-shell {
    padding: 16px;
  }

  .login-panel,
  .portal {
    padding: 18px;
  }

  .topbar,
  .hero-panel,
  .library-header,
  .guidance-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    top: 8px;
    gap: 14px;
    padding: 104px 14px 14px;
  }

  .topbar-brand {
    min-height: auto;
  }

  .topbar-logo {
    left: 50%;
    top: 0;
    width: min(280px, 86%);
    height: 130px;
    transform: translate(-50%, -26px);
  }

  .topbar-search {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions button {
    flex: 1;
  }

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

  .hero-panel h1 {
    font-size: 25px;
  }

  .hero-badge {
    min-width: 0;
  }
}
