/* SafeSurf.Pro portal — design tokens ported 1:1 from the React build.
   Dark navy foundation, cyan primary, gold accent, Manrope. */

:root {
  --radius: 0.75rem;

  --background: oklch(0.28 0.07 270);
  --foreground: oklch(0.98 0 0);
  --card: oklch(0.2 0.05 270);
  --primary: oklch(0.72 0.18 230);
  --primary-foreground: oklch(0.15 0.05 250);
  --secondary: oklch(0.45 0.18 280);
  --muted: oklch(0.35 0.05 270);
  --muted-foreground: oklch(0.7 0.02 260);
  --accent: oklch(0.82 0.16 85);
  --accent-foreground: oklch(0.15 0.05 250);
  --destructive: oklch(0.62 0.22 25);
  --success: oklch(0.7 0.16 155);
  --border: oklch(1 0 0 / 12%);
  --input: oklch(1 0 0 / 12%);

  --navy: oklch(0.28 0.07 270);
  --indigo: oklch(0.45 0.18 280);
  --cyan: oklch(0.72 0.18 230);
  --cyan-glow: oklch(0.72 0.18 230 / 0.25);
  --gold: oklch(0.82 0.16 85);
}

*,
*::before,
*::after { box-sizing: border-box; border-color: var(--border); }

html {
  font-family: "Manrope", ui-sans-serif, system-ui, -apple-system, sans-serif;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--background);
  color: var(--foreground);
  font-size: 15px;
  line-height: 1.55;
}

h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: 1.875rem; }
h2 { font-size: 1.125rem; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------- layout ---------- */

.container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: 1rem;
}
@media (min-width: 768px) { .container { padding-inline: 1.5rem; } }

.page { padding-block: 2rem; }
.stack { display: grid; gap: 0.5rem; }
.muted { color: var(--muted-foreground); }
.small { font-size: 0.875rem; }
.tiny { font-size: 0.8125rem; }
.strong { font-weight: 600; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.center { display: flex; align-items: center; justify-content: center; }

.site-header {
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--card) 50%, transparent);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}
.site-header .logo img { height: 1.75rem; width: auto; }
.header-right { display: flex; align-items: center; gap: 1rem; }
.header-email { display: none; }
@media (min-width: 640px) { .header-email { display: inline; } }

.portal-nav {
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--card) 30%, transparent);
  overflow-x: auto;
}
.portal-nav .container { display: flex; gap: 0.25rem; }
.portal-nav a {
  padding: 0.75rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.portal-nav a:hover { color: var(--foreground); }
.portal-nav a.is-active { color: var(--foreground); border-bottom-color: var(--cyan); }

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding-block: 1.5rem;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
}

/* ---------- cards ---------- */

.card {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: calc(var(--radius) + 8px);
  padding: 1.5rem;
}
.card-link { transition: border-color 0.15s, transform 0.15s; display: block; }
.card-link:hover { border-color: color-mix(in oklab, var(--cyan) 50%, transparent); }

.glass-card {
  background: oklch(1 0 0 / 5%);
  backdrop-filter: blur(12px);
  border: 1px solid oklch(1 0 0 / 10%);
}
.glow { box-shadow: 0 0 40px -10px var(--cyan-glow); }

.grid { display: grid; gap: 1.5rem; }
@media (min-width: 700px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* ---------- forms ---------- */

label { display: block; font-size: 0.875rem; font-weight: 500; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-size: 0.875rem;
  color: var(--foreground);
  background: var(--background);
  border: 1px solid var(--input);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 20%, transparent);
}
textarea { min-height: 7rem; resize: vertical; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 9999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s, opacity 0.15s, border-color 0.15s;
}
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { background: color-mix(in oklab, var(--primary) 90%, black); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--foreground); }
.btn-outline:hover { background: oklch(1 0 0 / 6%); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.link { color: var(--cyan); font-weight: 600; }
.link:hover { text-decoration: underline; }
.linkbtn {
  background: none; border: 0; padding: 0; font: inherit;
  color: var(--cyan); font-weight: 600; cursor: pointer;
}

/* ---------- feedback ---------- */

.alert {
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  font-size: 0.875rem;
}
.alert-error { background: color-mix(in oklab, var(--destructive) 12%, transparent); color: var(--destructive); }
.alert-success { background: color-mix(in oklab, var(--success) 12%, transparent); color: var(--success); }
.alert-info { background: color-mix(in oklab, var(--cyan) 12%, transparent); color: var(--cyan); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}
.badge-active { background: color-mix(in oklab, var(--success) 15%, transparent); color: var(--success); }
.badge-muted { background: oklch(1 0 0 / 8%); color: var(--muted-foreground); }
.badge-warn { background: color-mix(in oklab, var(--gold) 15%, transparent); color: var(--gold); }

/* ---------- auth screen ---------- */

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 3rem 1rem;
  background: radial-gradient(ellipse at top, var(--indigo) 0%, var(--background) 55%);
}
.auth-card {
  width: 100%;
  max-width: 27rem;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: calc(var(--radius) + 8px);
  padding: 2rem;
  box-shadow: 0 24px 60px -25px rgb(0 0 0 / 65%);
}
.auth-card .logo { display: flex; justify-content: center; margin-bottom: 1.5rem; }
.auth-card .logo img { height: 2rem; width: auto; }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th, td { text-align: left; padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted-foreground); font-weight: 600; font-size: 0.8125rem; }
tr:last-child td { border-bottom: 0; }
