/* Spoofsignal Design System */
/* Typography: Crimson Text (serif) for headings, system fonts for body */

@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:ital,wght@0,400;0,600;1,400&display=swap');

/* ===== CSS VARIABLES ===== */
:root {
  --color-primary: #6B9BD2;
  --color-primary-hover: #5a8bc4;
  --color-text: #3a3a3a;
  --color-text-light: #5a6478;
  --color-success: #059669;
  --color-error: #8B1538;
  --color-warning: #d97706;
  --color-background: #f0f2f5;
  --color-card: #ffffff;
  --color-border: rgba(90, 100, 120, 0.2);
  --font-serif: 'Crimson Text', 'Times New Roman', Times, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', Consolas, monospace;
  --radius: 12px;
  --radius-sm: 6px;
  --shadow: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.08);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text-light);
  background: var(--color-background);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--color-text);
  line-height: 1.2;
}

h2::before {
  content: '.';
  font-size: 1.15em;
  margin-right: 0.1em;
}

a { color: var(--color-primary); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.8; text-decoration: underline; }
a:focus { outline: 2px solid var(--color-primary); outline-offset: 2px; }

strong { font-weight: 600; color: var(--color-text); }
small { font-size: 0.875rem; color: var(--color-text-light); }

/* ===== LAYOUT ===== */
.container { max-width: 1400px; margin: 0 auto; padding: 2rem 2.5rem; }

/* ===== HEADER ===== */
.header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 2.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}
.logo-link:hover { text-decoration: none; opacity: 1; }

.main-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--color-text);
  margin: 0;
}
.main-title::before { display: none; }

.nav-menu {
  display: flex;
  gap: 0.25rem;
  margin-left: 2rem;
}

.nav-link {
  color: var(--color-text-light);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  transition: all 0.15s;
}
.nav-link:hover {
  color: var(--color-text);
  background: rgba(107, 155, 210, 0.08);
  text-decoration: none;
  opacity: 1;
}

.header-end {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-link {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--color-text-light);
}
.user-link:hover { color: var(--color-primary); text-decoration: none; opacity: 1; }

/* ===== ORGANIC BUBBLE LOGO ===== */
.logo-bubble {
  width: 42px;
  height: 42px;
  background: var(--color-primary);
  flex-shrink: 0;
  filter: blur(0.3px);
  animation: organicMorph 12s ease-in-out infinite;
}

@keyframes organicMorph {
  0%    { border-radius: 63% 37% 54% 46% / 55% 48% 52% 45%; transform: scale(1) rotate(0deg); }
  12.5% { border-radius: 40% 60% 67% 33% / 48% 62% 38% 52%; transform: scale(1.03) rotate(2deg); }
  25%   { border-radius: 46% 54% 39% 61% / 72% 28% 69% 31%; transform: scale(1.08) rotate(-1deg); }
  37.5% { border-radius: 71% 29% 58% 42% / 36% 74% 26% 64%; transform: scale(1.12) rotate(3deg); }
  50%   { border-radius: 34% 66% 72% 28% / 59% 41% 73% 27%; transform: scale(1.18) rotate(-2deg); }
  62.5% { border-radius: 58% 42% 31% 69% / 47% 68% 32% 53%; transform: scale(1.14) rotate(1deg); }
  75%   { border-radius: 29% 71% 49% 51% / 68% 32% 61% 39%; transform: scale(1.09) rotate(-1.5deg); }
  87.5% { border-radius: 52% 48% 68% 32% / 41% 59% 28% 72%; transform: scale(1.04) rotate(0.5deg); }
  100%  { border-radius: 63% 37% 54% 46% / 55% 48% 52% 45%; transform: scale(1) rotate(0deg); }
}

/* ===== AUTH ===== */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 2rem;
  background: var(--color-background);
}

.auth-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}

.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-header h1 { font-size: 1.75rem; margin-top: 0.75rem; }
.auth-header h1::before { display: none; }
.auth-subtitle { color: var(--color-text-light); margin-top: 0.25rem; }
.auth-form { display: flex; flex-direction: column; gap: 1.25rem; }
.auth-footer { text-align: center; margin-top: 1.5rem; color: var(--color-text-light); font-size: 0.875rem; }

.logo-bubble-lg {
  width: 80px;
  height: 80px;
  background: var(--color-primary);
  margin: 0 auto 1rem;
  filter: blur(0.3px);
  animation: organicMorph 12s ease-in-out infinite;
}

/* ===== FORMS ===== */
.form-group { display: flex; flex-direction: column; gap: 0.375rem; }
.form-group label { font-size: 0.875rem; font-weight: 500; color: var(--color-text); }

input[type="text"], input[type="email"], input[type="password"],
input[type="url"], input[type="tel"], input[type="search"],
select, textarea {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid rgba(90, 100, 120, 0.3);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--color-text);
  font-size: 0.9375rem;
  font-family: var(--font-sans);
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(107, 155, 210, 0.2);
}

.form-hint { font-size: 0.8125rem; color: var(--color-text-light); }
.form-actions { display: flex; gap: 0.75rem; margin-top: 0.5rem; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid rgba(90, 100, 120, 0.3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-sans);
  text-decoration: none;
  color: var(--color-text);
  background: transparent;
}
.btn:hover { text-decoration: none; opacity: 1; background: rgba(107, 155, 210, 0.08); border-color: var(--color-primary); transform: translateY(-1px); }

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

.btn-danger { background: transparent; color: var(--color-error); border-color: var(--color-error); }
.btn-danger:hover { background: var(--color-error); color: white; }

.btn-ghost { background: transparent; color: var(--color-text-light); border-color: transparent; }
.btn-ghost:hover { color: var(--color-text); background: rgba(107, 155, 210, 0.06); border-color: transparent; }

.btn-sm { padding: 0.3rem 0.625rem; font-size: 0.8125rem; }
.btn-full { width: 100%; }

/* ===== CARDS ===== */
.card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}
.card h2 { font-size: 1.375rem; margin-bottom: 1rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.card-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.card-header-row h2 { margin-bottom: 0; }

/* ===== STATS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.stat-value { font-size: 2rem; font-weight: 600; color: var(--color-text); font-family: var(--font-serif); }
.stat-label { color: var(--color-text-light); font-size: 0.875rem; margin-top: 0.25rem; }
.stat-link { font-size: 0.8125rem; display: inline-block; margin-top: 0.5rem; }
.stat-hint { font-size: 0.8125rem; color: var(--color-text-light); display: inline-block; margin-top: 0.5rem; }

/* ===== TABLES ===== */
.table-container { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--color-border);
}
th {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--color-text);
  background: rgba(107, 155, 210, 0.05);
  font-size: 0.875rem;
  white-space: nowrap;
}
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]:hover { background: rgba(107, 155, 210, 0.1); }
th .sort-arrow { font-size: 0.7rem; margin-left: 0.25rem; opacity: 0.3; }
th.sort-asc .sort-arrow, th.sort-desc .sort-arrow { opacity: 1; }
tr:hover td { background: rgba(107, 155, 210, 0.03); }

.table-search {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  width: 280px;
  margin-bottom: 0.75rem;
  background: white;
}
.table-search:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(107, 155, 210, 0.2);
}
.table-search::placeholder { color: var(--color-text-light); }

/* ===== BADGES ===== */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 999px;
}
.badge-success { background: rgba(5, 150, 105, 0.1); color: var(--color-success); }
.badge-warning { background: rgba(217, 119, 6, 0.1); color: var(--color-warning); }
.badge-danger { background: rgba(139, 21, 56, 0.1); color: var(--color-error); }
.badge-muted { background: rgba(90, 100, 120, 0.08); color: var(--color-text-light); }

/* ===== ALERTS ===== */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.875rem;
}
.alert-error { background: rgba(139, 21, 56, 0.06); color: var(--color-error); border: 1px solid rgba(139, 21, 56, 0.15); }
.alert-success { background: rgba(5, 150, 105, 0.06); color: var(--color-success); border: 1px solid rgba(5, 150, 105, 0.15); }

/* ===== CODE ===== */
code {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  background: rgba(107, 155, 210, 0.08);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: var(--color-text);
}

.code-block {
  background: rgba(107, 155, 210, 0.04);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin: 1rem 0;
  overflow-x: auto;
}
.code-block code { background: none; padding: 0; color: var(--color-text); }

/* ===== PAGE STRUCTURE ===== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.page-header h1 { font-size: 2rem; margin: 0; }
.page-header h1::before { display: none; }

.page-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--color-card);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
}
.empty-state h2 { margin-bottom: 0.5rem; }
.empty-state p { color: var(--color-text-light); margin-bottom: 1.5rem; }

/* ===== DETAIL VIEWS ===== */
.threat-meta { margin-top: 0.5rem; }
.meta-row {
  display: flex;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--color-border);
}
.meta-row:last-child { border-bottom: none; }
.meta-label { font-size: 0.875rem; color: var(--color-text-light); min-width: 140px; flex-shrink: 0; }
.meta-value { font-size: 0.875rem; color: var(--color-text); }

.tag {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  font-size: 0.75rem;
  background: rgba(107, 155, 210, 0.1);
  color: var(--color-primary);
  border-radius: 4px;
  margin-right: 0.25rem;
}

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

/* ===== DOMAIN DETAIL ===== */
.verify-steps { margin: 1rem 0; }
.verify-steps ol { padding-left: 1.5rem; }
.verify-steps li { margin-bottom: 0.5rem; color: var(--color-text-light); }

.monitoring-list { list-style: none; }
.monitoring-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--color-border);
}
.monitoring-list li:last-child { border-bottom: none; }

.risk-score-large { font-size: 3rem; font-weight: 600; text-align: center; padding: 1rem; font-family: var(--font-serif); }
.risk-score-low { color: var(--color-success); }
.risk-score-medium { color: var(--color-warning); }
.risk-score-high { color: var(--color-error); }

/* ===== DMARC / SCORES ===== */
.score-badge {
  font-size: 1.25rem;
  font-weight: 600;
  font-family: var(--font-serif);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
}
.score-good { background: rgba(5, 150, 105, 0.1); color: var(--color-success); }
.score-fair { background: rgba(217, 119, 6, 0.1); color: var(--color-warning); }
.score-poor { background: rgba(139, 21, 56, 0.1); color: var(--color-error); }

.issues-section { margin-top: 1.5rem; }
.issues-section h3 { font-size: 1rem; margin-bottom: 0.75rem; }

.issue {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--color-background);
  border: 1px solid var(--color-border);
}
.issue-severity { flex-shrink: 0; align-self: flex-start; }
.issue-content { flex: 1; }
.issue-fix {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: white;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-primary);
  overflow-x: auto;
}
.issue-fix code { font-size: 0.8125rem; color: var(--color-text); }

/* ===== FILTER & PAGINATION ===== */
.filter-group { display: flex; gap: 0.25rem; }
.pagination { display: flex; gap: 0.5rem; justify-content: center; margin-top: 1.5rem; }

/* ===== TIMELINE ===== */
.timeline { display: flex; flex-direction: column; gap: 0.5rem; }
.timeline-event {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.timeline-icon { font-size: 1.25rem; flex-shrink: 0; }
.timeline-content { flex: 1; }
.timeline-title { font-weight: 500; color: var(--color-text); }
.timeline-meta { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.25rem; font-size: 0.8125rem; }

/* ===== NOTIFICATION FORM ===== */
.notif-form { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }
.notif-form .form-group { flex: 1; min-width: 200px; }

/* ===== PRICING ===== */
.pricing-card { margin-top: 1rem; }
.price { font-family: var(--font-serif); font-size: 2.5rem; color: var(--color-text); }
.price-period { font-size: 1rem; color: var(--color-text-light); }
.pricing-features { list-style: none; margin: 1rem 0; }
.pricing-features li { padding: 0.375rem 0; color: var(--color-text-light); }
.pricing-features li::before { content: '\2713 '; color: var(--color-success); margin-right: 0.5rem; }

/* ===== UTILITIES ===== */
.text-muted { color: var(--color-text-light); }
.text-success { color: var(--color-success); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .header { flex-wrap: wrap; padding: 1rem; gap: 0.5rem; }
  .nav-menu { order: 3; width: 100%; overflow-x: auto; }
  .container { padding: 1.5rem 1rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-header h1 { font-size: 1.5rem; }
  .table-search { width: 100%; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .meta-row { flex-direction: column; gap: 0.25rem; }
  .meta-label { min-width: auto; }
}
