/* ===================================================
   YLP Document Vault & Verification System
   Shared tokens + base — palette inherited from ylpuaf.com
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;0,700;1,400&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Brand — same values as ylpuaf.com */
  --brand-purple: #11007b;
  --brand-purple-dark: #0a0058;
  --brand-purple-mid: #1a0ea0;
  --brand-purple-light: #2518b8;
  --brand-purple-faint: rgba(17, 0, 123, 0.08);

  --navy-900: #07003d;
  --navy-800: #0b0050;
  --navy-700: #0f0068;

  --silver-100: #f8f8f8;
  --silver-200: #ebebeb;
  --silver-300: #d4d4d4;
  --silver-400: #b8b8b8;
  --silver-500: #8e8e8e;

  --white: #ffffff;
  --text-primary: #f0f0f8;
  --text-secondary: #b0b0cc;
  --text-muted: #7a7a99;

  --border: rgba(255, 255, 255, 0.1);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --glass: rgba(255, 255, 255, 0.04);
  --glass-hover: rgba(255, 255, 255, 0.08);

  /* DVS-specific additions, kept close to the existing system */
  --seal-gold: #c9a227;          /* used sparingly — the wax-seal accent */
  --ok-green: #1f9d63;
  --ok-green-bg: rgba(31, 157, 99, 0.12);
  --danger-red: #d23a3a;
  --danger-red-bg: rgba(210, 58, 58, 0.12);
  --warn-amber: #c9942f;
  --warn-amber-bg: rgba(201, 148, 47, 0.12);

  --font-display: 'Cormorant Garamond', serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius: 4px;
  --radius-lg: 8px;
  --radius-xl: 16px;
  --shadow: 0 4px 24px rgba(17, 0, 123, 0.3);
  --shadow-lg: 0 12px 48px rgba(17, 0, 123, 0.5);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { font-size: 16px; }

body {
  font-family: var(--font-body);
  background-color: var(--navy-900);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: var(--font-body); color: inherit; }
input, select, textarea { font-family: var(--font-body); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.container { max-width: 1280px; margin: 0 auto; padding: 0 2rem; position: relative; z-index: 1; }
.container--narrow { max-width: 720px; margin: 0 auto; padding: 0 2rem; position: relative; z-index: 1; }

.label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--silver-500);
}

/* ─── Buttons ───────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: var(--transition);
  white-space: nowrap;
}

.btn--primary {
  background: var(--brand-purple);
  color: var(--white);
}
.btn--primary:hover:not(:disabled) {
  background: var(--brand-purple-mid);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(17, 0, 123, 0.4);
}

.btn--outline {
  border: 1px solid var(--border);
  color: var(--silver-300);
  background: var(--glass);
}
.btn--outline:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.2);
  background: var(--glass-hover);
  color: var(--white);
}

.btn--ghost { color: var(--silver-300); padding: 0.75rem 1rem; }
.btn--ghost:hover:not(:disabled) { color: var(--white); }

.btn--danger { background: var(--danger-red); color: var(--white); }
.btn--danger:hover:not(:disabled) { background: #b82e2e; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--sm { padding: 0.5rem 1rem; font-size: 0.78rem; }
.btn--full { width: 100%; }

/* ─── Forms ─────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.25rem; }

.field__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--silver-300);
  letter-spacing: 0.02em;
}
.field__label .optional { color: var(--text-muted); font-weight: 400; text-transform: none; letter-spacing: 0; }

.field__hint { font-size: 0.75rem; color: var(--text-muted); }

.input, .textarea, .select {
  width: 100%;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--white);
  padding: 0.75rem 1rem;
  font-size: 0.92rem;
  transition: var(--transition);
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--brand-purple-light);
  box-shadow: 0 0 0 3px rgba(37, 24, 184, 0.25);
  background: rgba(255, 255, 255, 0.06);
}
.textarea { resize: vertical; min-height: 90px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* ─── Cards / glass panels ──────────────────────── */
.panel {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(6px);
}

/* ─── Badges ────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge--active { background: var(--ok-green-bg); color: var(--ok-green); }
.badge--revoked { background: var(--danger-red-bg); color: var(--danger-red); }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ─── Toast ─────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  background: var(--navy-800);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.25rem;
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transform: translateY(20px);
  opacity: 0;
  transition: var(--transition);
  pointer-events: none;
  max-width: 360px;
}
.toast.visible { transform: translateY(0); opacity: 1; }
.toast--error { border-color: rgba(210, 58, 58, 0.4); }
.toast--success { border-color: rgba(31, 157, 99, 0.4); }

/* ─── Scrollbar (subtle, matches dark theme) ───── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* ─── Spinner ───────────────────────────────────── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
