/* public/style.css - TILIK.AI Security Suite Design System */
:root {
  --canvas: #E8E9ED;
  --surface: #FFFFFF;
  --surface-alt: #F4F5F7;
  --charcoal: #1A1B1E;
  --charcoal-light: #2A2C32;
  --charcoal-border: rgba(255, 255, 255, 0.12);
  --lime: #D4EC5E;
  --lime-dark: #3B4B04;
  --lime-light: #EEF6C4;
  --lavender: #B9B1F8;
  --lavender-dark: #372E7B;
  --lavender-light: #ECE9FD;
  --text-main: #18191C;
  --text-sub: #6C707A;
  --text-muted: #9CA3AF;
  --border-light: #E2E4EA;
  --critical: #EF4444;
  --critical-bg: #FEE2E2;
  --critical-text: #991B1B;
  --high: #F97316;
  --high-bg: #FFEDD5;
  --high-text: #9A3412;
  --medium: #F59E0B;
  --medium-bg: #FEF3C7;
  --medium-text: #92400E;
  --safe: #10B981;
  --safe-bg: #D1FAE5;
  --safe-text: #065F46;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-xl: 34px;
  --radius-pill: 999px;
  --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 20px 50px rgba(20, 21, 26, 0.08);
  --shadow-hover: 0 24px 60px rgba(20, 21, 26, 0.14);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: radial-gradient(circle at 18% 20%, #dcd9f8 0%, var(--canvas) 45%, #dfe3d5 100%);
  min-height: 100vh;
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

code, pre, .mono {
  font-family: 'JetBrains Mono', monospace;
}

/* AUTHENTICATION VIEW */
#authView {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.login-shell {
  width: 100%;
  max-width: 920px;
  background: #F4F5F7;
  border-radius: var(--radius-xl);
  box-shadow: 0 28px 65px rgba(20, 21, 26, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.85);
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  overflow: hidden;
}

@media (max-width: 780px) {
  .login-shell {
    grid-template-columns: 1fr;
  }
  .visual-pane {
    display: none !important;
  }
}

.visual-pane {
  background: var(--charcoal);
  color: #ffffff;
  padding: 2.75rem 2.4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--lime);
  color: var(--charcoal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
  box-shadow: 0 4px 12px rgba(212, 236, 94, 0.35);
}

.brand-row h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-row p {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.orb-showcase {
  position: relative;
  height: 210px;
  margin: 1.5rem 0;
}

.orb-1 {
  position: absolute;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  background: var(--lavender);
  color: var(--charcoal);
  left: 10px;
  top: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.25);
  animation: floatOrb1 6s ease-in-out infinite alternate;
}

.orb-2 {
  position: absolute;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: var(--lime);
  color: var(--charcoal);
  left: 122px;
  top: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.3);
  animation: floatOrb2 7s ease-in-out infinite alternate;
}

.orb-3 {
  position: absolute;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #2A2C32;
  border: 2px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  left: 225px;
  top: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  animation: floatOrb3 8s ease-in-out infinite alternate;
}

@keyframes floatOrb1 { 0% { transform: translate(0, 0); } 100% { transform: translate(6px, -10px); } }
@keyframes floatOrb2 { 0% { transform: translate(0, 0); } 100% { transform: translate(-8px, 12px); } }
@keyframes floatOrb3 { 0% { transform: translate(0, 0); } 100% { transform: translate(8px, 8px); } }

.orb-big { font-size: 1.45rem; letter-spacing: -0.03em; }
.orb-sm { font-size: 0.68rem; opacity: 0.85; margin-top: 2px; }

.visual-foot h2 {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 0.55rem;
}

.visual-foot p {
  font-size: 0.82rem;
  color: #9CA3AF;
  line-height: 1.55;
}

.form-pane {
  padding: 2.75rem 2.5rem;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #EEF6C4;
  color: #364405;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  width: fit-content;
  margin-bottom: 0.9rem;
}

.form-pane h2 {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.35rem;
}

.form-pane .sub {
  font-size: 0.84rem;
  color: var(--text-sub);
  margin-bottom: 1.6rem;
}

.field-group {
  margin-bottom: 1.1rem;
}

.field-group label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  color: #374151;
  margin-bottom: 0.42rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap input {
  width: 100%;
  padding: 0.82rem 1rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-light);
  background: #F8F9FB;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  outline: none;
  transition: all 0.16s ease;
}

.input-wrap input:focus {
  border-color: var(--charcoal);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(212, 236, 94, 0.45);
}

.toggle-pw {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-sub);
  cursor: pointer;
  padding: 4px 6px;
}

.error-box {
  display: none;
  background: var(--critical-bg);
  border: 1px solid #FCA5A5;
  color: var(--critical-text);
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.btn-login {
  width: 100%;
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--charcoal);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.16s ease;
  margin-top: 0.4rem;
}

.btn-login:hover {
  background: #2c2e33;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(26, 27, 30, 0.2);
}

.sec-note {
  margin-top: 1.35rem;
  padding-top: 1rem;
  border-top: 1px solid #ECEEF2;
  display: flex;
  justify-content: space-between;
  font-size: 0.73rem;
  color: var(--text-sub);
}

/* DASHBOARD SHELL */
#dashboardView {
  display: none;
  min-height: 100vh;
  background: #F8F9FA;
  padding-bottom: 4rem;
}

/* NAVBAR */
.top-nav {
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #F1F3F5;
  padding: 0.25rem;
  border-radius: var(--radius-pill);
}

.tab-btn {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-sub);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  background: #FFFFFF;
  color: var(--charcoal);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.auditor-badge {
  background: var(--lime-light);
  color: var(--lime-dark);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-logout {
  background: #F1F3F5;
  border: none;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-sub);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.16s ease;
}

.btn-logout:hover {
  background: #E5E7EB;
  color: var(--critical-text);
}

/* MAIN CONTENT WRAPPER */
.main-wrap {
  max-width: 1320px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.2s ease-in-out;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* CARDS & METRICS */
.grid-posture {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

@media (max-width: 1024px) {
  .grid-posture { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-posture { grid-template-columns: 1fr; }
}

.metric-card {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-subtle);
  position: relative;
  overflow: hidden;
}

.metric-card .label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.metric-card .value {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--charcoal);
  margin-bottom: 0.35rem;
}

.metric-card .caption {
  font-size: 0.78rem;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* HERO POSTURE CARD */
.hero-posture-banner {
  background: var(--charcoal);
  color: #FFFFFF;
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  margin-bottom: 2rem;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2rem;
  position: relative;
  overflow: hidden;
}

@media (max-width: 860px) {
  .hero-posture-banner { grid-template-columns: 1fr; }
}

.hero-posture-banner h2 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.hero-posture-banner p {
  color: #D1D5DB;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.75rem;
}

.action-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--lime);
  color: var(--charcoal);
  font-weight: 800;
  font-size: 0.88rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.16s ease;
}

.btn-primary:hover {
  background: #c3de48;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(212, 236, 94, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.16s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

.posture-radar-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--charcoal-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* SECTION CARD */
.card-section {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-subtle);
  margin-bottom: 2rem;
}

.card-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.card-section-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.card-section-header p {
  font-size: 0.82rem;
  color: var(--text-sub);
}

/* DRAG AND DROP ZONE */
.dropzone-box {
  border: 2px dashed #CBD5E1;
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  background: #F8FAFC;
  transition: all 0.2s ease;
  cursor: pointer;
  margin-bottom: 1.5rem;
}

.dropzone-box:hover, .dropzone-box.dragover {
  border-color: var(--charcoal);
  background: #F1F5F9;
}

.dropzone-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: var(--lavender-light);
  color: var(--lavender-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.6rem;
}

/* SAMPLES SELECTOR */
.sample-models-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.sample-chip {
  background: #EEF2F6;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sample-chip:hover {
  background: var(--charcoal);
  color: #FFFFFF;
}

/* FINDINGS & BADGES */
.badge-sev {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
}

.badge-sev.CRITICAL { background: var(--critical-bg); color: var(--critical-text); }
.badge-sev.HIGH { background: var(--high-bg); color: var(--high-text); }
.badge-sev.MEDIUM { background: var(--medium-bg); color: var(--medium-text); }
.badge-sev.LOW { background: #E0F2FE; color: #0369A1; }
.badge-sev.SAFE { background: var(--safe-bg); color: var(--safe-text); }

/* TABLES */
.data-table-wrap {
  overflow-x: auto;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.84rem;
}

.custom-table th {
  background: #F8F9FA;
  padding: 0.75rem 1rem;
  font-weight: 800;
  color: var(--text-sub);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  border-bottom: 1.5px solid var(--border-light);
}

.custom-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #ECEEF2;
  vertical-align: middle;
}

.custom-table tr:hover td {
  background: #FBFBFC;
}

/* PROMPT FUZZER SPLIT */
.fuzzer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

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

.console-output {
  background: var(--charcoal);
  color: #E2E8F0;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  font-size: 0.82rem;
  height: 480px;
  overflow-y: auto;
  border: 1px solid var(--charcoal-border);
}

.console-entry {
  margin-bottom: 0.9rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* PRINT REPORT STYLES */
@media print {
  body {
    background: #FFFFFF !important;
    color: #000000 !important;
  }
  .top-nav, .action-row, .btn-primary, .btn-secondary, .dropzone-box, .sample-models-row {
    display: none !important;
  }
  #dashboardView {
    display: block !important;
    padding: 0 !important;
  }
  .card-section {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
}
