:root {
  --navy: #05111f;
  --navy-2: #0b1e34;
  --panel: #0f2843;
  --cyan: #00c8f5;
  --cyan-dim: #0891b8;
  --red: #e11d2e;
  --text: #e8f1f8;
  --text-dim: #9fb3c8;
  --border: #1c3a56;
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', Roboto, -apple-system, sans-serif;
  background: var(--navy);
  color: var(--text);
  min-height: 100vh;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--navy-2);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand .name { font-size: 20px; font-weight: 700; letter-spacing: 0.5px; }
.brand .powered {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--red);
  font-weight: 700;
  margin-top: 3px;
}
.brand .logo-chip {
  background: #f7fafc;
  border-radius: 6px;
  padding: 3px 7px;
  display: flex;
  align-items: center;
  line-height: 0;
}
.brand .logo-chip img { height: 14px; display: block; }

.topbar-right { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.topbar-right .firm { color: var(--text-dim); }
.btn-link { background: none; border: none; color: var(--cyan); cursor: pointer; font-size: 14px; padding: 0; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.auth-card { width: 100%; max-width: 380px; }

h1, h2, h3 { margin-top: 0; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; color: var(--cyan); }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 5px; }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--navy);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cyan-dim); }

.btn {
  display: inline-block;
  background: var(--cyan);
  color: var(--navy);
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.btn:hover { background: #33d4ff; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary { background: transparent; color: var(--cyan); border: 1px solid var(--cyan-dim); }
.btn-secondary:hover { background: rgba(0,200,245,0.08); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }

.error-msg { color: var(--danger); font-size: 13px; margin-top: 8px; min-height: 16px; }
.hint { color: var(--text-dim); font-size: 12px; margin-top: 6px; }

.row { display: flex; gap: 10px; align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; }
.spacer { flex: 1; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--text-dim); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; }
tr:hover td { background: rgba(255,255,255,0.02); }

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge-new { background: rgba(148,163,184,0.15); color: #cbd5e1; }
.badge-awaiting_info { background: rgba(245,158,11,0.15); color: var(--warn); }
.badge-analyzed { background: rgba(0,200,245,0.15); color: var(--cyan); }
.badge-drafted { background: rgba(34,197,94,0.15); color: var(--ok); }
.badge-closed { background: rgba(148,163,184,0.15); color: var(--text-dim); }
.badge-error { background: rgba(239,68,68,0.15); color: var(--danger); }

.empty-state { text-align: center; padding: 50px 20px; color: var(--text-dim); }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; }
.hidden { display: none !important; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

.section { margin-bottom: 26px; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--text-dim); }
.kv dd { margin: 0; }

.list-plain { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.6; }
.prose { font-size: 14px; line-height: 1.7; white-space: pre-wrap; }

.spinner {
  border: 3px solid var(--border);
  border-top-color: var(--cyan);
  border-radius: 50%;
  width: 22px; height: 22px;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab { padding: 10px 16px; cursor: pointer; color: var(--text-dim); font-size: 14px; border-bottom: 2px solid transparent; }
.tab.active { color: var(--cyan); border-bottom-color: var(--cyan); }

.file-drop {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
}
.file-drop:hover { border-color: var(--cyan-dim); }

.disclaimer-footer {
  max-width: 1100px;
  margin: 30px auto 10px;
  padding: 14px 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
}
.disclaimer-footer .icon { flex-shrink: 0; opacity: 0.7; margin-top: 1px; }
.disclaimer-footer strong { color: var(--text); font-weight: 600; }

.disclaimer-auth {
  max-width: 380px;
  margin: 0 auto;
  padding: 0 4px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-dim);
  text-align: center;
}

/* ===== Split-panel auth layout (login/signup/forgot/reset), matching TRecon's login screen ===== */
.auth-split {
  display: flex;
  min-height: 100vh;
  background: #ffffff;
}

.auth-split-left {
  flex: 0 0 38%;
  max-width: 560px;
  min-width: 320px;
  background: linear-gradient(160deg, #0a1830 0%, #1e3a66 100%);
  color: #ffffff;
  padding: 56px 48px;
  display: flex;
  flex-direction: column;
}

.auth-split-left .brandname {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.auth-split-left .brandname .accent { color: #9ecbfa; }
.auth-split-left .underline {
  width: 56px;
  height: 3px;
  background: #9ecbfa;
  margin: 12px 0 10px;
  border-radius: 2px;
}
.auth-split-left .kicker {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 1.6px;
  color: #b9cbe8;
  text-transform: uppercase;
}

.auth-split-left .icon-box {
  width: 52px;
  height: 52px;
  border: 1.5px solid #4d6ea3;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 34px 0 26px;
}

.auth-split-left .headline {
  font-size: 27px;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 26px;
}

.auth-split-left .feature-list {
  list-style: none;
  margin: 0 0 auto;
  padding: 0;
}
.auth-split-left .feature-list li {
  display: flex;
  align-items: flex-start;
  font-size: 15px;
  line-height: 1.6;
  color: #dbe6f7;
  margin-bottom: 16px;
}
.auth-split-left .feature-list .check {
  flex-shrink: 0;
  color: #9ecbfa;
  font-weight: 700;
  margin-top: 1px;
  margin-right: 10px;
}

.auth-split-left .powered-row {
  display: flex;
  align-items: center;
  margin-top: 40px;
}
.auth-split-left .powered-row .label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #f0a35b;
  margin-right: 10px;
}
.auth-split-left .powered-row .chip {
  background: #ffffff;
  border-radius: 6px;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  line-height: 0;
}
.auth-split-left .powered-row .chip img { height: 16px; display: block; }

.auth-split-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.auth-split-right-inner {
  width: 100%;
  max-width: 420px;
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #eaf2ff;
  color: #2e5aa8;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 100px;
  margin-bottom: 26px;
}

.auth-form-title {
  font-size: 28px;
  font-weight: 800;
  color: #101828;
  margin: 0 0 6px;
}
.auth-form-subtitle {
  font-size: 15px;
  color: #667085;
  margin: 0 0 28px;
}

.auth-field { margin-bottom: 20px; }
.auth-field label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #1d2939;
  margin-bottom: 7px;
}
.auth-field input, .auth-field select {
  width: 100%;
  padding: 12px 14px;
  background: #ffffff;
  border: 1.5px solid #d0d5dd;
  border-radius: 8px;
  color: #101828;
  font-size: 15px;
  font-family: inherit;
}
.auth-field input:focus, .auth-field select:focus {
  outline: none;
  border-color: #2e5aa8;
}
.auth-field .field-hint { font-size: 12.5px; color: #667085; margin-top: 6px; }

.auth-btn {
  width: 100%;
  padding: 13px;
  background: #2e5aa8;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.auth-btn:hover { background: #274d90; }
.auth-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.auth-switch {
  text-align: center;
  margin-top: 22px;
  font-size: 14.5px;
  color: #667085;
}
.auth-switch a { color: #2e5aa8; font-weight: 700; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

.auth-notice {
  background: #fff7e6;
  border: 1px solid #f5c26b;
  color: #7a4b00;
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 20px;
}

.auth-error {
  color: #d92d20;
  font-size: 13.5px;
  margin-top: 10px;
  min-height: 16px;
}

.auth-disclaimer {
  text-align: center;
  font-size: 12px;
  font-style: italic;
  color: #98a2b3;
  margin-top: 26px;
  line-height: 1.6;
}

@media (max-width: 860px) {
  .auth-split { flex-direction: column; }
  .auth-split-left { max-width: none; flex: none; padding: 36px 28px; }
  .auth-split-left .feature-list { display: none; }
  .auth-split-right { padding: 36px 20px; }
}
