@import url("https://fonts.googleapis.com/css2?family=Changa:wght@200..800&display=swap");

:root {
  --bg: #ffffff;
  --surface: rgba(255, 255, 255, 0.98);
  --surface-strong: #ffffff;
  --text: #122e60;
  --muted: #52698f;
  --line: rgba(18, 46, 96, 0.18);
  --accent: #e30613;
  --accent-strong: #c80511;
  --primary: #122e60;
  --primary-soft: rgba(18, 46, 96, 0.04);
  --soft: #f3f7ff;
  --danger: #e30613;
  --shadow: 0 18px 50px rgba(18, 46, 96, 0.08);
  --shadow-strong: 0 24px 60px rgba(18, 46, 96, 0.12);
  --header-bg: rgba(18, 46, 96, 0.94);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(227, 6, 19, 0.08), transparent 24%),
    radial-gradient(circle at top right, rgba(18, 46, 96, 0.12), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #f3f7ff 100%);
  color: var(--text);
  font-family: "Changa", "Segoe UI", sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  min-height: 42px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: white;
  padding: 0 18px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(227, 6, 19, 0.22);
  transition:
    background-color 160ms ease,
    color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--accent-strong);
}

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

.secondary-button {
  border-color: var(--line);
  background: rgba(18, 46, 96, 0.03);
  color: var(--primary);
  box-shadow: none;
}

.danger-button {
  border-color: var(--danger);
  background: var(--danger);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 24px 32px;
  background: var(--header-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 10px 30px rgba(18, 46, 96, 0.22);
}

.topbar h1 {
  margin: 0 0 6px;
  font-size: 28px;
  letter-spacing: 0.02em;
  color: #ffffff;
}

.topbar p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
}

.brand-eyebrow,
.section-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.brand-eyebrow {
  margin-bottom: 4px;
}

.topbar-brand {
  display: grid;
  gap: 2px;
}

.topbar-brand h1 {
  text-transform: uppercase;
}

.topbar-brand p {
  max-width: 640px;
}

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

.topbar-actions button {
  white-space: nowrap;
}

.topbar-actions #loginHeaderButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topbar-actions #menuButton {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.topbar-actions #menuButton:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
}

.current-user {
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 13px;
  white-space: nowrap;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 24, 52, 0.52);
  backdrop-filter: blur(6px);
}

.auth-modal {
  position: relative;
  width: min(980px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 2rem;
  background:
    linear-gradient(135deg, rgba(18, 46, 96, 0.04), rgba(255, 255, 255, 0.98)),
    #ffffff;
  box-shadow: var(--shadow-strong);
}

.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 18px;
}

.auth-box {
  height: 100%;
}

.register-box {
  align-content: start;
}

.register-copy {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.7;
}

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

.auth-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: -4px 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.text-button {
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--primary);
  box-shadow: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-button:hover:not(:disabled) {
  transform: none;
  background: transparent;
  color: var(--accent);
}

.reset-modal {
  width: min(560px, 100%);
}

.user-manager-modal {
  width: min(1180px, 100%);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.menu-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(520px, 100vw);
  height: 100vh;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(18, 46, 96, 0.04), rgba(255, 255, 255, 0.98)),
    #ffffff;
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-strong);
  overflow-y: auto;
  z-index: 30;
}

.menu-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 20px;
}

.menu-head h2 {
  margin-bottom: 6px;
}

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

.menu-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.drawer-panel {
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background: var(--surface);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.helper-text {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  padding: 32px 32px 48px;
  max-width: 1280px;
  margin: 0 auto;
}

.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  padding: 24px;
  box-shadow: var(--shadow);
}

.hero-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 2rem;
  background: linear-gradient(135deg, rgba(18, 46, 96, 0.04), rgba(255, 255, 255, 0.98));
}

.hero-copy {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

h2,
h3 {
  margin: 0 0 16px;
  letter-spacing: 0;
  font-weight: 600;
}

.panel h2 {
  font-size: 1.9rem;
}

.section-head h2 {
  margin-bottom: 0;
}

h4 {
  margin: 0 0 8px;
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
  font-weight: 700;
}

.auth-notice {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(18, 46, 96, 0.03);
  padding: 8px 12px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.input-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(260px, 1fr) minmax(360px, 1.5fr);
  gap: 16px;
  align-items: start;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--text);
  box-shadow: inset 0 1px 2px rgba(18, 46, 96, 0.04);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.12);
}

.password-field {
  position: relative;
}

.password-field input {
  min-width: 0;
  padding-right: 50px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--primary);
  box-shadow: none;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover:not(:disabled) {
  transform: translateY(-50%);
  background: rgba(18, 46, 96, 0.08);
}

.password-toggle.is-visible {
  color: var(--accent);
}

.eye-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
}

.eye-icon svg {
  width: 18px;
  height: 18px;
}

textarea {
  resize: vertical;
  min-height: 130px;
  line-height: 1.45;
}

.candidate-input textarea {
  min-height: 218px;
}

.actions,
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.copy-controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.copy-status {
  min-width: 120px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.collapsible-panel .section-head {
  margin-bottom: 0;
}

.collapsible-body {
  margin-top: 16px;
}

.panel-toggle {
  min-height: auto;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.menu-head h2,
.drawer-panel h3,
.panel h3 {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.panel-toggle:hover {
  color: var(--accent-strong);
}

.toggle-indicator {
  width: 18px;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 14px;
  line-height: 1;
}

#promptPreview {
  min-height: 260px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  font-weight: 400;
}

#statusText {
  color: var(--muted);
}

.result-summary {
  margin-bottom: 18px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(18, 46, 96, 0.04), rgba(255, 255, 255, 0.96));
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.98);
}

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

.comparison-table {
  min-width: 980px;
}

.comparison-table th,
.comparison-table td {
  min-width: 220px;
}

.comparison-table .feature-column {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 220px;
  background: #f8fbff;
}

.comparison-table tbody .feature-column {
  background: #ffffff;
}

.column-score {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #f8fbff;
  font-size: 13px;
  color: var(--primary);
}

tbody tr:last-child td {
  border-bottom: none;
}

a {
  color: var(--accent-strong);
}

.comparison-table a {
  color: inherit;
  text-decoration: none;
}

.comparison-table a:hover,
.comparison-table a:focus {
  color: var(--accent-strong);
  text-decoration: none;
}

.score {
  font-weight: 800;
}

.json-output {
  max-height: 340px;
  overflow: auto;
  margin-top: 0;
  border-radius: 1.25rem;
  padding: 14px;
  background: #0f244c;
  color: #f2f7fa;
  white-space: pre-wrap;
}

.user-manager-wrap {
  max-height: min(62vh, 620px);
}

.user-manager-table {
  min-width: 2060px;
}

.user-manager-table th:first-child,
.user-manager-table td:first-child {
  min-width: 740px;
}

.user-manager-table th:nth-child(4),
.user-manager-table td:nth-child(4) {
  min-width: 440px;
}

.user-manager-table th:nth-child(3),
.user-manager-table td:nth-child(3) {
  min-width: 130px;
  text-align: center;
}

.user-manager-table td input {
  min-width: 180px;
}

.user-manager-table td label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-weight: 600;
}

.user-manager-table td label input[type="checkbox"] {
  width: auto;
}

.user-manager-table .field-label {
  display: grid;
  align-items: stretch;
  gap: 6px;
}

.identity-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(190px, 1fr));
  align-items: start;
  gap: 18px;
}

.status-field-grid {
  display: inline-grid;
  width: max-content;
  margin: 0 auto;
  justify-items: start;
  gap: 8px;
}

.user-manager-table .checkbox-label {
  display: grid;
  grid-template-columns: 16px max-content;
  justify-content: start;
  align-items: center;
  gap: 4px;
  margin: 0;
  white-space: nowrap;
}

.user-manager-table .checkbox-label input[type="checkbox"] {
  margin: 0;
  justify-self: center;
}

.manager-password-field input {
  min-width: 220px;
}

.password-reset-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) max-content;
  align-items: end;
  gap: 12px;
}

.password-reset-grid .field-label {
  margin-bottom: 0;
}

.password-reset-grid button[data-action="reset-password"] {
  margin-bottom: 0;
  white-space: nowrap;
}

.user-date-cell {
  min-width: 150px;
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
}

.site-footer {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(18, 46, 96, 0.02), rgba(18, 46, 96, 0.08));
}

.footer-grid {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px;
  display: grid;
  gap: 24px;
  grid-template-columns: 1.2fr 1fr 1fr;
}

.footer-column {
  display: grid;
  gap: 12px;
}

.footer-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.footer-copy {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
  max-width: 560px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-links span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px 14px;
  font-size: 13px;
  color: var(--primary);
  box-shadow: var(--shadow);
}

.hidden {
  display: none;
}

@media (max-width: 1040px) {
  .input-grid {
    grid-template-columns: 1fr;
  }

  .auth-grid,
  .register-grid {
    grid-template-columns: 1fr;
  }

  .hero-head {
    align-items: start;
    flex-direction: column;
  }

  .hero-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

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

@media (max-width: 720px) {
  .topbar,
  .layout {
    padding-left: 16px;
    padding-right: 16px;
  }

  .topbar {
    gap: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .topbar h1 {
    margin-bottom: 2px;
    font-size: 20px;
    line-height: 1.1;
  }

  .topbar p {
    font-size: 12px;
    line-height: 1.25;
  }

  .brand-eyebrow {
    margin-bottom: 0;
    font-size: 10px;
    letter-spacing: 0.16em;
  }

  .topbar-brand {
    gap: 0;
  }

  .topbar-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  .topbar-actions button {
    width: max-content;
    min-width: max-content;
    min-height: 34px;
    padding: 0 12px;
    font-size: 13px;
  }

  .current-user {
    display: none;
  }

  .actions,
  .section-head {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

  .menu-drawer {
    width: 100vw;
    padding: 16px;
  }

  .menu-actions {
    grid-template-columns: 1fr;
  }

  .modal-shell {
    padding: 16px;
  }

  .auth-modal {
    padding: 18px;
    border-radius: 1.5rem;
  }

  .user-manager-modal .menu-head {
    display: grid;
  }

  .modal-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .auth-meta {
    align-items: start;
    flex-direction: column;
  }

  .hero-head {
    padding: 18px;
    border-radius: 1.5rem;
  }

  .panel h2 {
    font-size: 1.5rem;
  }

  .footer-grid {
    padding: 24px 16px 32px;
  }

  .copy-controls {
    justify-content: start;
  }

  .copy-status {
    min-width: 0;
    text-align: left;
  }
}
