/*
 * ContentHub Design System
 * Dark theme inspired by InContext AI design language
 *
 * Brand Colors:
 * - brand-dark: #0D0D1A (primary background)
 * - brand-light-dark: #161625 (card/elevated surfaces)
 * - brand-primary: #FFFFFF (primary text)
 * - brand-secondary: #A0A0B0 (secondary text)
 * - brand-accent: #2EE5D4 (accent/CTA)
 */

/* ============================================
   CSS RESET & BASE
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   BRAND COLORS
   ============================================ */
:root {
  --brand-dark: #0D0D1A;
  --brand-light-dark: #161625;
  --brand-primary: #FFFFFF;
  --brand-secondary: #A0A0B0;
  --brand-accent: #2EE5D4;
  --brand-accent-hover: #25c7b8;
  --brand-error: #ef4444;
  --brand-success: #22c55e;
  --brand-warning: #f59e0b;
  --brand-info: #3b82f6;
}

/* ============================================
   BACKGROUND UTILITIES
   ============================================ */
.bg-brand-dark { background-color: var(--brand-dark); }
.bg-brand-light-dark { background-color: var(--brand-light-dark); }
.bg-brand-accent { background-color: var(--brand-accent); }
.bg-white { background-color: #ffffff; }
.bg-white\/5 { background-color: rgba(255, 255, 255, 0.05); }
.bg-white\/10 { background-color: rgba(255, 255, 255, 0.1); }
.bg-white\/20 { background-color: rgba(255, 255, 255, 0.2); }
.bg-black\/50 { background-color: rgba(0, 0, 0, 0.5); }
.bg-red-500\/10 { background-color: rgba(239, 68, 68, 0.1); }
.bg-green-500\/10 { background-color: rgba(34, 197, 94, 0.1); }
.bg-blue-500\/10 { background-color: rgba(59, 130, 246, 0.1); }

/* Gradient backgrounds */
.bg-gradient-dark {
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-light-dark) 100%);
}

.bg-gradient-accent {
  background: linear-gradient(135deg, var(--brand-accent) 0%, #1eb8aa 100%);
}

/* ============================================
   TEXT COLORS
   ============================================ */
.text-white { color: #ffffff; }
.text-black { color: #000000; }
.text-brand-primary { color: var(--brand-primary); }
.text-brand-secondary { color: var(--brand-secondary); }
.text-brand-accent { color: var(--brand-accent); }
.text-gray-300 { color: #d1d5db; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-red-400 { color: #f87171; }
.text-red-500 { color: #ef4444; }
.text-green-400 { color: #4ade80; }
.text-green-500 { color: #22c55e; }

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, #60A5FA 0%, #FFFFFF 50%, #2EE5D4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-5xl { font-size: 3rem; line-height: 1.1; }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }

.tracking-tight { letter-spacing: -0.025em; }
.tracking-wide { letter-spacing: 0.025em; }

.leading-tight { line-height: 1.25; }
.leading-relaxed { line-height: 1.625; }

/* ============================================
   LAYOUT - FLEXBOX
   ============================================ */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }

.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }

.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* ============================================
   LAYOUT - GRID
   ============================================ */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ============================================
   SPACING
   ============================================ */
.m-0 { margin: 0; }
.m-auto { margin: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.my-2 { margin-top: 0.5rem; margin-bottom: 0.5rem; }
.my-4 { margin-top: 1rem; margin-bottom: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.ml-2 { margin-left: 0.5rem; }
.mr-2 { margin-right: 0.5rem; }

.p-0 { padding: 0; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }

/* ============================================
   SIZING
   ============================================ */
.w-full { width: 100%; }
.w-auto { width: auto; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.w-10 { width: 2.5rem; }
.w-12 { width: 3rem; }
.w-16 { width: 4rem; }
.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }

.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-16 { height: 4rem; }
.min-h-screen { min-height: 100vh; }

/* ============================================
   POSITIONING
   ============================================ */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }

/* ============================================
   BORDERS
   ============================================ */
.border { border-width: 1px; border-style: solid; }
.border-2 { border-width: 2px; border-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-white\/10 { border-color: rgba(255, 255, 255, 0.1); }
.border-white\/20 { border-color: rgba(255, 255, 255, 0.2); }
.border-white\/30 { border-color: rgba(255, 255, 255, 0.3); }
.border-brand-accent { border-color: var(--brand-accent); }
.border-brand-accent\/40 { border-color: rgba(46, 229, 212, 0.4); }
.border-red-500 { border-color: #ef4444; }
.border-red-500\/30 { border-color: rgba(239, 68, 68, 0.3); }
.border-green-500 { border-color: #22c55e; }
.border-green-500\/30 { border-color: rgba(34, 197, 94, 0.3); }
.border-transparent { border-color: transparent; }

.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }

/* ============================================
   EFFECTS
   ============================================ */
.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }

.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.opacity-100 { opacity: 1; }

.backdrop-blur { backdrop-filter: blur(8px); }
.backdrop-blur-sm { backdrop-filter: blur(4px); }
.backdrop-blur-md { backdrop-filter: blur(12px); }

/* ============================================
   TRANSITIONS
   ============================================ */
.transition { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-colors { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.duration-200 { transition-duration: 200ms; }
.duration-300 { transition-duration: 300ms; }

.transform { transform: translateX(var(--tw-translate-x, 0)) translateY(var(--tw-translate-y, 0)) rotate(var(--tw-rotate, 0)) skewX(var(--tw-skew-x, 0)) skewY(var(--tw-skew-y, 0)) scaleX(var(--tw-scale-x, 1)) scaleY(var(--tw-scale-y, 1)); }

/* ============================================
   DISPLAY & VISIBILITY
   ============================================ */
.block { display: block; }
.inline-block { display: inline-block; }
.hidden { display: none; }
.invisible { visibility: hidden; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

/* ============================================
   INTERACTIVITY
   ============================================ */
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }
.select-none { user-select: none; }
.pointer-events-none { pointer-events: none; }

.outline-none { outline: 2px solid transparent; outline-offset: 2px; }
.focus\:outline-none:focus { outline: 2px solid transparent; outline-offset: 2px; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px var(--brand-accent); }
.focus\:ring-brand-accent:focus { box-shadow: 0 0 0 2px var(--brand-accent); }

/* ============================================
   FORM ELEMENTS
   ============================================ */
.form-input {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--brand-primary);
  background-color: var(--brand-light-dark);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  transition: all 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(46, 229, 212, 0.1);
}

.form-input::placeholder {
  color: var(--brand-secondary);
}

.form-input.error {
  border-color: var(--brand-error);
}

.form-input.success {
  border-color: var(--brand-success);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand-primary);
  margin-bottom: 0.5rem;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--brand-secondary);
  margin-top: 0.25rem;
}

.form-error {
  font-size: 0.75rem;
  color: var(--brand-error);
  margin-top: 0.25rem;
}

/* Form group with stacked inputs */
.form-group {
  margin-bottom: 1rem;
}

.form-stacked-top {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-width: 1px;
}

.form-stacked-middle {
  border-radius: 0;
  border-bottom-width: 1px;
  margin-top: -1px;
}

.form-stacked-bottom {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  margin-top: -1px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.btn-primary {
  color: #000000;
  background-color: var(--brand-accent);
  border-color: var(--brand-accent);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--brand-accent-hover);
  border-color: var(--brand-accent-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  color: var(--brand-primary);
  background-color: transparent;
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover:not(:disabled) {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.btn-ghost {
  color: var(--brand-secondary);
  background-color: transparent;
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  color: var(--brand-primary);
  background-color: rgba(255, 255, 255, 0.05);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-block {
  display: flex;
  width: 100%;
}

/* ============================================
   ALERTS & MESSAGES
   ============================================ */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  border: 1px solid;
}

.alert-error {
  background-color: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.alert-success {
  background-color: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: #86efac;
}

.alert-warning {
  background-color: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fcd34d;
}

.alert-info {
  background-color: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background-color: var(--brand-light-dark);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 2rem;
}

.card-elevated {
  background-color: rgba(22, 22, 37, 0.8);
  backdrop-filter: blur(12px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* ============================================
   CONTENTHUB LOGO
   ============================================ */
.contenthub-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2rem;
}

.contenthub-logo svg {
  max-width: 100%;
  height: auto;
}

.byline {
  font-size: 0.625rem;
  color: var(--brand-secondary);
  letter-spacing: 0.1em;
}

/* ============================================
   LINKS
   ============================================ */
a {
  color: var(--brand-accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--brand-accent-hover);
  text-decoration: underline;
}

.link-muted {
  color: var(--brand-secondary);
}

.link-muted:hover {
  color: var(--brand-primary);
}

/* ============================================
   SPINNER / LOADING
   ============================================ */
.spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

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

/* ============================================
   DIVIDERS
   ============================================ */
.divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  color: var(--brand-secondary);
  font-size: 0.875rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: rgba(255, 255, 255, 0.1);
}

.divider::before {
  margin-right: 1rem;
}

.divider::after {
  margin-left: 1rem;
}

/* ============================================
   PASSWORD FIELD
   ============================================ */
.password-field {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--brand-secondary);
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.password-toggle:hover {
  color: var(--brand-accent);
}

.password-field .form-input {
  padding-right: 3rem;
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */
@media (min-width: 640px) {
  .sm\:flex-row { flex-direction: row; }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:text-lg { font-size: 1.125rem; }
  .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (min-width: 768px) {
  .md\:flex { display: flex; }
  .md\:hidden { display: none; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto !important;
  }
}

/* ============================================
   DARK MODE AUTH PAGE LAYOUT
   ============================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background-color: var(--brand-dark);
  background-image:
    radial-gradient(ellipse at 25% 25%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 75% 75%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
}

.auth-card {
  width: 100%;
  max-width: 28rem;
  background-color: var(--brand-light-dark);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.5rem;
  padding: 2.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand-primary);
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  font-size: 0.875rem;
  color: var(--brand-secondary);
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.875rem;
  color: var(--brand-secondary);
}

/* Social login buttons */
.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.75rem 1rem;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--brand-primary);
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.social-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ============================================
   LIST STYLES
   ============================================ */
.list-none { list-style: none; }
ul.list-none, ol.list-none { padding-left: 0; }
