/*
 * PDF Services - shared theme (CODECYCLE visual identity).
 * This file is duplicated in website/assets/css and admin/assets/css: keep both copies identical.
 */

:root {
  --bg: #0b1120;
  --bg-2: #0f172a;
  --surface: #111a2e;
  --surface-2: #16213a;
  --surface-3: #1e293b;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.3);

  --text: #f1f5f9;
  --text-2: #cbd5e1;
  --muted: #94a3b8;
  --faint: #64748b;

  --primary: #8b5cf6;
  --primary-600: #7c3aed;
  --primary-300: #c4b5fd;
  --primary-soft: rgba(139, 92, 246, 0.14);
  --primary-glow: rgba(139, 92, 246, 0.35);
  --accent: #06b6d4;
  --accent-soft: rgba(6, 182, 212, 0.12);
  --pink: #ec4899;

  --success: #10b981;
  --success-soft: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.12);
  --danger: #f43f5e;
  --danger-soft: rgba(244, 63, 94, 0.12);

  --code-keyword: #f472b6;
  --code-string: #34d399;
  --code-number: #fbbf24;
  --code-property: #22d3ee;
  --code-comment: #64748b;

  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.7);
  --focus: 0 0 0 3px rgba(139, 92, 246, 0.45);

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

[v-cloak] {
  display: none !important;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--primary-300);
  text-decoration: none;
}

a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.75rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.25rem); }
h3 { font-size: 1.25rem; }

p {
  margin: 0 0 1em;
}

code,
kbd,
pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

:not(pre) > code {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1em 0.4em;
  color: var(--primary-300);
}

::selection {
  background: var(--primary-glow);
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--font-mono); }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Background grid + glow, as in codecycle.com.br */
.grid-bg {
  background-image:
    radial-gradient(ellipse 60% 50% at 20% 0%, rgba(124, 58, 237, 0.22), transparent 70%),
    radial-gradient(ellipse 40% 40% at 90% 20%, rgba(6, 182, 212, 0.10), transparent 70%),
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: auto, auto, 56px 56px, 56px 56px;
}

/* Brand: the CODE logo is navy; it is rendered white on the dark theme. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
  color: var(--text);
}

.brand img {
  height: 26px;
  width: auto;
  filter: brightness(0) invert(1);
}

.brand .brand-divider {
  width: 1px;
  height: 22px;
  background: var(--border-strong);
}

.brand .brand-product {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.brand .brand-product span {
  color: var(--primary-300);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: 600 0.95rem/1.2 var(--font-body);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn[disabled],
.btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 24px -10px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-600);
  color: #fff;
}

.btn-ghost {
  background: rgba(15, 23, 42, 0.6);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #e11d48;
  color: #fff;
}

.btn-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary-300);
  font-weight: 500;
}

.btn-link:hover {
  color: var(--text);
  text-decoration: underline;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 24px;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

/* Cards */
.card {
  background: rgba(17, 26, 46, 0.72);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

/* Forms */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
}

.input,
.field input:not([type="checkbox"]):not([type="radio"]),
.field select,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: 400 0.95rem/1.4 var(--font-body);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--focus);
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: var(--danger);
}

.field-error {
  color: #fda4af;
  font-size: 0.82rem;
}

.field-hint {
  color: var(--faint);
  font-size: 0.82rem;
}

.checkbox {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.9rem;
  color: var(--text-2);
}

.checkbox input {
  margin-top: 4px;
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

/* Alerts */
.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 0.92rem;
  margin-bottom: 16px;
}

.alert-info { border-color: rgba(6, 182, 212, 0.35); background: var(--accent-soft); }
.alert-success { border-color: rgba(16, 185, 129, 0.35); background: var(--success-soft); }
.alert-warning { border-color: rgba(245, 158, 11, 0.35); background: var(--warning-soft); }
.alert-error { border-color: rgba(244, 63, 94, 0.4); background: var(--danger-soft); color: #fecdd3; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--primary-soft);
  color: var(--primary-300);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-accent { background: var(--accent-soft); color: #67e8f9; border-color: rgba(6, 182, 212, 0.3); }
.badge-success { background: var(--success-soft); color: #6ee7b7; border-color: rgba(16, 185, 129, 0.3); }
.badge-muted { background: var(--surface-3); color: var(--muted); border-color: var(--border); }

/* Code blocks */
.code {
  position: relative;
  background: #0a0f1c;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--faint);
  font: 500 0.78rem/1 var(--font-mono);
}

.code-dots {
  display: inline-flex;
  gap: 6px;
}

.code-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #334155;
}

.code pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  color: var(--text-2);
  font-size: 0.85rem;
  line-height: 1.7;
}

.code .k { color: var(--code-keyword); }
.code .s { color: var(--code-string); }
.code .n { color: var(--code-number); }
.code .p { color: var(--code-property); }
.code .c { color: var(--code-comment); }

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table th,
.table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.table td.num,
.table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
