/* Zyphertek Portal — navy #1F3864, teal #00B0B7, predominantly white */

:root {
  --navy: #1f3864;
  --navy-dark: #16284a;
  --teal: #00b0b7;
  --teal-dark: #00939a;
  --teal-soft: #e6f7f8;
  --white: #ffffff;
  --page: #f4f7fa;
  --text: #1f3864;
  --muted: #5b6b7c;
  --line: #d9e1ea;
  --error: #9b2c2c;
  --error-bg: #fdeeee;
  --shadow: 0 8px 24px rgba(31, 56, 100, 0.08);
  --radius: 12px;
  --header-h: 72px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--page);
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--teal-dark);
}

a:hover {
  color: var(--navy);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--navy);
  color: var(--white);
  padding: 8px 12px;
  z-index: 100;
}

.skip-link:focus {
  left: 8px;
  top: 8px;
}

.site-header {
  background: var(--white);
  border-bottom: 3px solid var(--teal);
  min-height: var(--header-h);
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.brand img {
  display: block;
  height: 32px;
  width: auto;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy);
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
}

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

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 36px 24px 64px;
}

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 32px;
}

.center-panel {
  max-width: 480px;
  margin: 48px auto 0;
  text-align: center;
}

.center-panel .logo {
  height: 40px;
  width: auto;
  margin-bottom: 20px;
}

.center-panel h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 650;
  color: var(--navy);
}

.lead {
  margin: 0 0 24px;
  color: var(--muted);
}

.note {
  margin: 20px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 18px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
}

.btn:focus-visible,
.link-btn:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--teal);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--teal-dark);
  color: var(--white);
}

.btn-ghost {
  background: transparent;
  color: var(--navy);
  border-color: var(--line);
}

.btn-ghost:hover {
  border-color: var(--navy);
  background: var(--page);
}

.welcome h1 {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 650;
}

.welcome p {
  margin: 0;
  color: var(--muted);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  margin: 24px 0 8px;
  align-items: flex-start;
}

.meta-block h2 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.role-pill,
.site-pill {
  display: inline-block;
  background: var(--teal-soft);
  color: var(--navy);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
  margin: 0 6px 6px 0;
}

.role-pill {
  background: var(--navy);
  color: var(--white);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 28px;
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  min-height: 180px;
  border-top: 3px solid var(--teal);
}

.card h2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 650;
}

.card p {
  margin: 0 0 16px;
  color: var(--muted);
  flex: 1;
}

.card .btn {
  align-self: flex-start;
}

.alert {
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 0 auto;
  max-width: 640px;
}

.alert h1 {
  margin: 0 0 8px;
  font-size: 22px;
}

.alert p {
  margin: 0 0 16px;
}

.alert-error {
  background: var(--error-bg);
  border: 1px solid #f0c6c6;
  color: var(--error);
}

.alert-info {
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--text);
}

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 72px;
  color: var(--muted);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--line);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.host-banner {
  background: #fff6e5;
  color: var(--navy);
  text-align: center;
  padding: 10px 16px;
  font-size: 14px;
  border-bottom: 1px solid #f0d9a6;
}

.host-banner a {
  font-weight: 700;
  color: var(--navy);
}

.site-footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 32px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 640px) {
  .header-inner {
    padding: 12px 16px;
  }

  .brand-text {
    display: none;
  }

  .user-name {
    max-width: 140px;
  }

  main {
    padding: 24px 16px 48px;
  }

  .center-panel,
  .panel {
    padding: 28px 20px;
  }

  .welcome h1 {
    font-size: 24px;
  }
}
