/**
 * Yavatar.AI — shared UI tokens (premium polish A + font B)
 * Palette unchanged: #0b0f19 / #131b2e / #3b82f6 / sky-400
 * v=20260723b — cache bust
 */

:root {
  --y-bg0: #0b0f19;
  --y-bg1: #131b2e;
  --y-card: rgba(17, 24, 39, 0.72);
  --y-card-solid: #0f1422;
  --y-border: #1f2937;
  --y-border-hover: #374151;
  --y-accent: #3b82f6;
  --y-accent-hover: #2563eb;
  --y-accent-soft: rgba(59, 130, 246, 0.14);
  --y-brand-ai: #38bdf8;
  --y-text: #f3f4f6;
  --y-muted: #9ca3af;
  --y-radius-sm: 0.5rem;
  --y-radius: 0.75rem;
  --y-radius-lg: 1rem;
  --y-radius-xl: 1.25rem;
  --y-shadow-card:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 18px 48px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(59, 130, 246, 0.06);
  --y-shadow-btn: 0 10px 28px rgba(37, 99, 235, 0.32);
  --y-font-sans: 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
  --y-font-display: 'Manrope', 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
  --y-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Beat Tailwind CDN preflight */
html.y-ui,
body.y-ui,
.y-ui {
  font-family: var(--y-font-sans) !important;
  color: var(--y-text);
  letter-spacing: -0.014em;
  line-height: 1.55;
}

.y-ui h1,
.y-ui h2,
.y-ui h3,
.y-ui .y-display,
.y-ui #welcomeTitle {
  font-family: var(--y-font-display) !important;
  letter-spacing: -0.035em !important;
  line-height: 1.18;
  font-weight: 700;
}

.y-gradient-bg {
  background: linear-gradient(155deg, var(--y-bg0) 0%, #10182a 48%, var(--y-bg1) 100%) !important;
  min-height: 100vh;
}

.y-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}
.y-brand-name { color: #f1f5f9; }
.y-brand-ai { color: var(--y-brand-ai); }

.y-card {
  background: var(--y-card);
  border: 1px solid rgba(55, 65, 81, 0.95);
  border-radius: var(--y-radius-xl);
  box-shadow: var(--y-shadow-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.y-ui .bg-gray-900\/50.border.border-gray-800,
.y-ui .bg-\[\#0f1422\].border.border-gray-800,
.y-ui .rounded-2xl.border.border-gray-800 {
  box-shadow: var(--y-shadow-card) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.y-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.85rem;
  padding: 0.7rem 1.35rem;
  border-radius: var(--y-radius-lg);
  font-family: var(--y-font-sans) !important;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background-color 0.2s var(--y-ease),
    border-color 0.2s var(--y-ease),
    box-shadow 0.2s var(--y-ease),
    transform 0.2s var(--y-ease),
    opacity 0.2s var(--y-ease);
  text-decoration: none;
}
.y-btn:active:not(:disabled) { transform: translateY(1px); }
.y-btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; transform: none; }
.y-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--y-accent-soft), 0 0 0 1px var(--y-accent);
}

.y-btn-primary {
  background: var(--y-accent);
  color: #fff;
  box-shadow: var(--y-shadow-btn);
}
.y-btn-primary:hover:not(:disabled) { background: var(--y-accent-hover); }

.y-btn-secondary {
  background: transparent;
  color: #60a5fa;
  border-color: var(--y-accent);
}
.y-btn-secondary:hover:not(:disabled) {
  background: var(--y-accent);
  color: #fff;
}

.y-btn-ghost {
  background: #1f2937;
  color: #e5e7eb;
  border-color: #374151;
}
.y-btn-ghost:hover:not(:disabled) {
  background: #374151;
  color: #fff;
}

.y-btn-block { width: 100%; }

.y-ui button.bg-blue-600,
.y-ui a.bg-blue-600 {
  border-radius: var(--y-radius-lg) !important;
  font-weight: 600 !important;
  letter-spacing: -0.02em;
  box-shadow: var(--y-shadow-btn) !important;
  transition: background-color 0.2s var(--y-ease), box-shadow 0.2s var(--y-ease), transform 0.2s var(--y-ease);
}
.y-ui button.bg-blue-600:hover,
.y-ui a.bg-blue-600:hover {
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.4) !important;
}
.y-ui button.bg-blue-600:focus-visible,
.y-ui a.bg-blue-600:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--y-accent-soft), 0 0 0 1px var(--y-accent) !important;
}

.y-ui a.rounded-full.bg-blue-600,
.y-ui a.rounded-full.border-blue-600 {
  font-weight: 600;
  letter-spacing: -0.02em;
}

.y-input {
  width: 100%;
  min-height: 2.85rem;
  padding: 0.8rem 1rem;
  background: #111827;
  border: 1px solid #374151;
  border-radius: var(--y-radius-lg);
  color: #fff;
  font-family: var(--y-font-sans) !important;
  font-size: 0.975rem;
  transition: border-color 0.2s var(--y-ease), box-shadow 0.2s var(--y-ease), background 0.2s var(--y-ease);
}
.y-input::placeholder { color: #6b7280; }
.y-input:hover { border-color: #4b5563; background: #0f172a; }
.y-input:focus {
  outline: none;
  border-color: var(--y-accent);
  box-shadow: 0 0 0 3px var(--y-accent-soft);
}

.y-label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--y-muted);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.y-link { color: #60a5fa; text-decoration: none; transition: color 0.15s ease; }
.y-link:hover { color: #93c5fd; }
.y-muted { color: var(--y-muted); }

.y-error {
  display: none;
  background: rgba(127, 29, 29, 0.35);
  border: 1px solid #b91c1c;
  color: #f87171;
  padding: 0.75rem 1rem;
  border-radius: var(--y-radius-lg);
  margin-bottom: 1rem;
  font-size: 0.875rem;
}
.y-error.show { display: block; }

.y-nav {
  background: rgba(11, 15, 25, 0.88) !important;
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid rgba(31, 41, 55, 0.95);
}

.y-auth-wrap {
  width: 100%;
  max-width: 26rem;
  margin: 0 auto;
  padding: 1rem;
}
.y-auth-wrap.y-auth-wide { max-width: 32rem; }

.y-checkbox {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--y-accent);
  cursor: pointer;
  flex-shrink: 0;
}

.y-ui .neon-border {
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.4), 0 16px 40px rgba(37, 99, 235, 0.22) !important;
}

.y-ui .sidebar-item {
  border-radius: var(--y-radius);
  transition: background-color 0.2s var(--y-ease), border-color 0.2s var(--y-ease);
}

.y-ui #appMain h1.text-3xl {
  font-family: var(--y-font-display) !important;
  letter-spacing: -0.035em !important;
}

.y-ui .bg-gradient-to-r.from-blue-600.to-sky-500 {
  box-shadow: 0 16px 40px rgba(37, 99, 235, 0.28);
}
