/* TalentGoat brand — navy + gold from logo */
:root {
  --tg-navy: #0a1268;
  --tg-navy-deep: #060d45;
  --tg-navy-mid: #1a2890;
  --tg-gold: #d4a843;
  --tg-gold-light: #e8c56a;
  --tg-white: #ffffff;
  --tg-off-white: #f4f6fc;
  --tg-text-muted: #6b7280;
  --tg-shadow: 0 20px 50px rgba(6, 13, 69, 0.18);
  --tg-radius: 16px;
  --tg-font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Logo sizes */
.tg-logo {
  display: block;
  object-fit: contain;
}

.tg-logo--hero {
  width: min(220px, 55vw);
  height: auto;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.25));
}

.tg-logo--card {
  width: 88px;
  height: auto;
  margin: 0 auto 1rem;
}

.tg-logo--nav {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.tg-logo--gate {
  width: 120px;
  height: auto;
  margin: 0 auto 1.25rem;
}

.tg-brand-name {
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--tg-navy);
}

/* Auth pages (login, register) */
body.tg-auth-page {
  margin: 0;
  min-height: 100vh;
  font-family: var(--tg-font);
  background: var(--tg-navy-deep);
  color: #1f2937;
}

.tg-auth-layout {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .tg-auth-layout {
    grid-template-columns: 1fr 1fr;
  }
}

.tg-auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(212, 168, 67, 0.12), transparent 60%),
    linear-gradient(160deg, var(--tg-navy-deep) 0%, var(--tg-navy) 45%, var(--tg-navy-mid) 100%);
  color: var(--tg-white);
  position: relative;
  overflow: hidden;
}

.tg-auth-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.tg-auth-brand > * {
  position: relative;
  z-index: 1;
}

.tg-auth-tagline {
  margin: 1.75rem 0 0;
  max-width: 320px;
  font-size: 1.05rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 400;
}

.tg-auth-features {
  margin-top: 2.5rem;
  padding: 0;
  list-style: none;
  text-align: left;
  max-width: 300px;
}

.tg-auth-features li {
  padding: 0.45rem 0 0.45rem 1.75rem;
  position: relative;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.75);
}

.tg-auth-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tg-gold);
}

.tg-auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background: var(--tg-off-white);
}

.tg-auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--tg-white);
  border-radius: var(--tg-radius);
  box-shadow: var(--tg-shadow);
  padding: 2.25rem 2rem 2rem;
  border: 1px solid rgba(10, 18, 104, 0.06);
}

.tg-auth-card--mobile-logo {
  display: none;
}

@media (max-width: 899px) {
  .tg-auth-brand {
    padding: 2.5rem 1.5rem 2rem;
    min-height: auto;
  }

  .tg-auth-tagline,
  .tg-auth-features {
    display: none;
  }

  .tg-auth-card--mobile-logo {
    display: block;
  }
}

.tg-auth-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--tg-navy);
  letter-spacing: -0.02em;
}

.tg-auth-subtitle {
  margin: 0 0 1.75rem;
  color: var(--tg-text-muted);
  font-size: 0.95rem;
}

.tg-auth-card .form-group {
  margin-bottom: 1rem;
}

.tg-auth-card label {
  font-weight: 600;
  font-size: 0.875rem;
  color: #374151;
}

.tg-auth-card input[type="text"],
.tg-auth-card input[type="email"],
.tg-auth-card input[type="password"] {
  border-radius: 10px;
  border: 1px solid #d1d5db;
  padding: 0.65rem 0.85rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.tg-auth-card input:focus {
  border-color: var(--tg-navy-mid);
  box-shadow: 0 0 0 3px rgba(26, 40, 144, 0.12);
  outline: none;
}

.tg-btn-primary {
  display: inline-block;
  width: 100%;
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--tg-navy) 0%, var(--tg-navy-mid) 100%);
  color: var(--tg-white) !important;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  text-align: center;
  text-decoration: none;
}

.tg-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(10, 18, 104, 0.28);
  color: var(--tg-white);
}

.tg-auth-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--tg-text-muted);
}

.tg-auth-footer a {
  color: var(--tg-navy-mid);
  font-weight: 600;
  text-decoration: none;
}

.tg-auth-footer a:hover {
  color: var(--tg-gold);
  text-decoration: underline;
}

/* App navbar brand */
.topnav {
  background: linear-gradient(135deg, var(--tg-navy-deep) 0%, var(--tg-navy) 50%, var(--tg-navy-mid) 100%) !important;
}

.topnav .tg-brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  float: left;
  background: rgba(255, 255, 255, 0.96);
  padding: 8px 22px 8px 14px;
  margin: 0;
  text-decoration: none;
  border-radius: 0 0 12px 0;
  transition: background 0.2s;
}

.topnav .tg-brand-link:hover {
  background: #fff;
  text-decoration: none;
}

.topnav h1.tg-brand-text-only {
  display: none;
}

/* Gate page (logged-out access required) */
.tg-gate-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  font-family: var(--tg-font);
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(212, 168, 67, 0.1), transparent),
    linear-gradient(160deg, var(--tg-navy-deep), var(--tg-navy));
}

.tg-gate-card {
  width: 100%;
  max-width: 420px;
  background: var(--tg-white);
  border-radius: var(--tg-radius);
  box-shadow: var(--tg-shadow);
  padding: 2.5rem 2rem;
  text-align: center;
}

.tg-gate-card h5 {
  color: var(--tg-navy);
  font-weight: 700;
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
}

.tg-gate-card .card-text {
  color: var(--tg-text-muted);
  margin-bottom: 1.75rem;
}

.tg-gate-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.tg-gate-actions .btn {
  min-width: 120px;
  border-radius: 10px;
  font-weight: 600;
}

.tg-gate-actions .btn-primary {
  background: var(--tg-navy);
  border-color: var(--tg-navy);
}

.tg-gate-actions .btn-outline-primary {
  color: var(--tg-navy);
  border-color: var(--tg-navy);
}

/* Password visibility toggle (auth forms) */
.tg-password-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.tg-password-wrap input {
  width: 100%;
  padding-right: 2.75rem !important;
  box-sizing: border-box;
}

.tg-password-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.tg-password-toggle:hover,
.tg-password-toggle:focus {
  color: var(--tg-navy-mid);
  background: rgba(26, 40, 144, 0.06);
  outline: none;
}

/* Performance metric info icons */
.tg-th-metric {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tg-th-metric--right {
  justify-content: flex-end;
}

.tg-metric-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: help;
  outline: none;
}

.tg-metric-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1.5px solid #6b7280;
  color: #6b7280;
  font-size: 10px;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1;
  background: rgba(255, 255, 255, 0.9);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.tg-metric-info--light .tg-metric-info-icon {
  border-color: rgba(255, 255, 255, 0.85);
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.tg-metric-info:hover .tg-metric-info-icon,
.tg-metric-info:focus .tg-metric-info-icon {
  border-color: var(--tg-navy-mid);
  color: var(--tg-navy-mid);
}

.tg-metric-info--light:hover .tg-metric-info-icon,
.tg-metric-info--light:focus .tg-metric-info-icon {
  border-color: #fff;
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
}

.tg-metric-info-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 240px;
  padding: 8px 11px;
  border-radius: 8px;
  background: #1f2937;
  color: #f9fafb;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s, visibility 0.15s;
  z-index: 50;
}

.tg-metric-info-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1f2937;
}

.tg-metric-info:hover .tg-metric-info-tooltip,
.tg-metric-info:focus .tg-metric-info-tooltip {
  opacity: 1;
  visibility: visible;
}

.tg-metric-info--below .tg-metric-info-tooltip {
  bottom: auto;
  top: calc(100% + 8px);
}

.tg-metric-info--below .tg-metric-info-tooltip::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: #1f2937;
}
