/* Self-hosted fonts */
@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/Inter-VariableFont_opsz_wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/JetBrainsMono[wght].ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Neutral Signal design tokens */
:root {
  --bg:           #FBFBFC;
  --bg-raised:    #FFFFFF;
  --fg-1:         #1E1E21;
  --fg-2:         #4A4A4F;
  --fg-3:         #7C7C83;
  --border-1:     #ECECEE;
  --border-2:     #D9D9DD;
  --ep-red:       #E24B4A;
  --ep-red-600:   #C63938;
  --ep-red-700:   #9F2A29;
  --ep-green:     #34A853;
  --ep-green-700: #216E37;
  --ep-gray:      #9A9AA0;

  --font-sans:    'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --fvs-display:  "opsz" 32;
  --ease-out:     cubic-bezier(0.22, 1, 0.36, 1);
}

/* Global reset */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: hidden; }

a       { color: var(--ep-red-600); }
a:hover { color: var(--ep-red-700); }
::selection { background: #C8E9D3; color: #0F3319; }

.hidden { display: none; }

/* Base */
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--fg-1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ══════════════════════════════════════════════════
   HOME — index.html (Hemsida Stealth)
   ══════════════════════════════════════════════════ */

body.home {
  min-height: 100vh;
  background: radial-gradient(120% 130% at 50% 38%, #FFFFFF 0%, #F5F5F6 55%, #ECECEE 100%);
  color: #1E1E21;
  overflow: hidden;
  max-width: 100%;
  font-family: var(--font-sans);
}

body.home a       { color: #4A4A4F; }
body.home a:hover { color: #1E1E21; }

.stealth-root {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.stealth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 36px 48px;
}

.stealth-wordmark {
  display: block;
  line-height: 1;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.04em;
  color: #1E1E21;
  font-variation-settings: var(--fvs-display);
}

.stealth-dot-word {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #E24B4A;
  animation: epColor 9s linear infinite, epBreathe 2.2s ease-in-out infinite;
  vertical-align: baseline;
  margin-left: 2px;
}

.stealth-status {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #9A9AA0;
}

.stealth-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
}

.stealth-signal {
  position: relative;
  width: 22px;
  height: 22px;
  margin-bottom: 56px;
}

.stealth-signal-ping,
.stealth-signal-core {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #E24B4A;
}

.stealth-signal-ping {
  animation: epColor 9s linear infinite, epPing 2.2s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

.stealth-signal-core {
  animation: epColor 9s linear infinite, epBreathe 2.2s ease-in-out infinite;
}

.stealth-h1 {
  font-family: var(--font-display);
  font-variation-settings: var(--fvs-display);
  font-size: clamp(38px, 6vw, 84px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.02;
  margin: 0;
  max-width: 16ch;
  color: #1E1E21;
  text-wrap: balance;
}

.stealth-lead {
  font-size: clamp(16px, 1.5vw, 20px);
  line-height: 1.55;
  color: #7C7C83;
  margin: 28px 0 0;
  max-width: 38ch;
  text-wrap: pretty;
}

.stealth-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 36px 48px;
}

.stealth-email {
  font-size: 15px;
  font-weight: 500;
  color: #4A4A4F;
  text-decoration: none;
}

.stealth-email:hover { color: #1E1E21; }

.stealth-copy {
  font-size: 13px;
  color: #9A9AA0;
}

@media (max-width: 600px) {
  .stealth-header { padding: 24px; }
  .stealth-footer { padding: 24px; }
}

/* ══════════════════════════════════════════════════
   AUTH — auth.html
   ══════════════════════════════════════════════════ */

body.auth {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

body.auth::before {
  content: '';
  position: fixed;
  top: -200px; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 400px;
  background: radial-gradient(ellipse, rgba(226, 75, 74, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-raised);
  border: 1px solid var(--border-2);
  border-radius: 16px;
  padding: 48px 40px;
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 32px rgba(30, 30, 33, 0.06);
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 160px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--ep-red-600), transparent);
  border-radius: 0 0 1px 1px;
}

.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 36px;
}

.auth-logo img.ep-mark    { width: 52px; height: 52px; }
.auth-logo img.ep-wordmark { height: 22px; opacity: 0.9; }

.report-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(226, 75, 74, 0.06);
  border: 1px solid rgba(226, 75, 74, 0.15);
  border-radius: 8px;
  margin-bottom: 28px;
}

.report-badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ep-red);
  flex-shrink: 0;
}

.report-badge-text {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-badge-text strong {
  color: var(--fg-1);
  font-weight: 500;
}

.auth-heading {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: var(--fg-1);
}

.auth-sub {
  font-size: 14px;
  color: var(--fg-2);
  line-height: 1.6;
  margin-bottom: 28px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg-3);
  display: block;
  margin-bottom: 6px;
}

.input-wrap { position: relative; }

.auth-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  padding: 13px 44px 13px 14px;
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.06em;
  color: var(--fg-1);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.auth-input::placeholder {
  color: var(--fg-3);
  letter-spacing: 0.02em;
  font-size: 14px;
}

.auth-input:focus {
  border-color: var(--ep-red-600);
  background: rgba(198, 57, 56, 0.04);
}

.auth-input.error-state {
  border-color: var(--ep-red);
  background: rgba(226, 75, 74, 0.05);
}

.toggle-visibility {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--fg-3);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.toggle-visibility:hover { color: var(--fg-2); }
.toggle-visibility svg   { width: 16px; height: 16px; }

.auth-submit {
  width: 100%;
  padding: 14px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
  background: var(--ep-red-600);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
}

.auth-submit:hover:not(:disabled) {
  background: var(--ep-red);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(226, 75, 74, 0.25);
}

.auth-submit:active:not(:disabled) { transform: translateY(0); }

.auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-arrow { transition: transform 0.15s; display: inline-block; }
.auth-submit:hover:not(:disabled) .btn-arrow { transform: translateX(3px); }

.auth-error {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(226, 75, 74, 0.07);
  border: 1px solid rgba(226, 75, 74, 0.2);
  border-radius: 6px;
  color: var(--ep-red-700);
  font-size: 13px;
  line-height: 1.4;
  margin-top: 4px;
}

.auth-error.visible { display: flex; }
.auth-error svg     { width: 14px; height: 14px; flex-shrink: 0; }

.attempt-hint {
  font-size: 12px;
  color: var(--fg-3);
  text-align: center;
  margin-top: 4px;
}

.auth-footer {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-1);
  text-align: center;
}

.auth-footer p {
  font-size: 12px;
  color: var(--fg-3);
  line-height: 1.6;
}

.auth-success {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.auth-success.visible { display: flex; }

.success-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(52, 168, 83, 0.12);
  border: 1px solid rgba(52, 168, 83, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ep-green);
}

.success-icon svg { width: 22px; height: 22px; }

.auth-success h3 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg-1);
}

.auth-success p {
  font-size: 14px;
  color: var(--fg-2);
}

@media (max-width: 480px) {
  .auth-card { padding: 32px 24px; }
}

/* ══════════════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════════════ */

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes dotIn {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes epColor {
  0%, 23%  { background: #E24B4A; }
  33%, 56% { background: #34A853; }
  66%, 89% { background: #9A9AA0; }
  100%     { background: #E24B4A; }
}

@keyframes epBreathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.1); }
}

@keyframes epPing {
  0%   { transform: scale(0.9); opacity: 0.5; }
  70%  { transform: scale(2.8); opacity: 0; }
  100% { transform: scale(2.8); opacity: 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .stealth-dot-word,
  .stealth-signal-ping,
  .stealth-signal-core {
    animation: none !important;
  }
}
