/* ═══════════════════════════════════════════
   GALO'S MOTOS — DESIGN SYSTEM
   ═══════════════════════════════════════════ */

/* ── Tokens ── */
:root {
  /* Backgrounds */
  --bg-body: #050507;
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: #16161f;
  --bg-card-hover: #1c1c28;
  --bg-input: #111118;
  --bg-header: rgba(10, 10, 15, 0.85);

  /* Accent — Blue palette */
  --accent: #2563eb;
  --accent-light: #3b82f6;
  --accent-dark: #1a3a5c;
  --accent-darker: #0f2440;
  --accent-glow: rgba(37, 99, 235, 0.12);
  --accent-glow-strong: rgba(37, 99, 235, 0.25);
  --accent-gradient: linear-gradient(135deg, #1a3a5c 0%, #2563eb 100%);

  /* Text */
  --text-primary: #eef0f6;
  --text-secondary: #7a7f92;
  --text-muted: #4a4e5c;
  --text-accent: #60a5fa;

  /* Semantic */
  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.1);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --warning: #f97316;
  --warning-bg: rgba(249, 115, 22, 0.1);
  --info: #06b6d4;
  --info-bg: rgba(6, 182, 212, 0.1);

  /* Borders */
  --border-color: rgba(255, 255, 255, 0.06);
  --border-color-hover: rgba(255, 255, 255, 0.12);
  --border-accent: rgba(37, 99, 235, 0.3);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.15);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* Typography */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'DM Sans', sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Header height */
  --header-height: 64px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text-primary);
  background: var(--bg-body);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

a {
  color: var(--accent-light);
  text-decoration: none;
}

img { max-width: 100%; display: block; }

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  outline: none;
}

input, select, textarea {
  font-family: var(--font-body);
  outline: none;
}

/* ── Utility ── */
.hidden { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--accent-dark);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ── Login Screen ── */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-body);
  background-image:
    radial-gradient(ellipse at 30% 20%, rgba(37, 99, 235, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(37, 99, 235, 0.04) 0%, transparent 50%);
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: var(--space-2xl) var(--space-lg);
  text-align: center;
}

.login-logo {
  margin-bottom: var(--space-2xl);
}

.login-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-md);
  animation: spin-slow 20s linear infinite;
}

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

.login-logo h1 {
  font-size: 2.2rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-weight: 500;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.login-error {
  color: var(--danger);
  font-size: 0.85rem;
  min-height: 1.2em;
  transition: var(--transition-fast);
}

/* ── App Layout ── */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 var(--space-lg);
  background: var(--bg-header);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.header-gear {
  width: 32px;
  height: 32px;
  animation: spin-slow 20s linear infinite;
}

.brand-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Nav Tabs ── */
.header-nav {
  display: flex;
  gap: var(--space-xs);
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  transition: all var(--transition-base);
  position: relative;
}

.nav-tab:hover {
  color: var(--text-primary);
  background: var(--accent-glow);
}

.nav-tab.active {
  color: var(--accent-light);
  background: var(--accent-glow-strong);
}

.nav-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: var(--accent);
  border-radius: var(--radius-full);
}

.nav-tab svg {
  flex-shrink: 0;
}

/* ── Logout ── */
.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  background: transparent;
  transition: all var(--transition-base);
}

.btn-logout:hover {
  color: var(--danger);
  background: var(--danger-bg);
}

/* ── Main Content ── */
.app-main {
  flex: 1;
  padding: var(--space-lg);
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.section {
  display: none;
  animation: fadeIn 0.3s ease;
}

.section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Section Header ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
}

.section-title svg {
  display: inline-block;
  vertical-align: middle;
  margin-right: var(--space-sm);
  color: var(--accent);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .app-header {
    flex-wrap: wrap;
    height: auto;
    padding: var(--space-sm) var(--space-md);
    gap: var(--space-sm);
  }

  .header-nav {
    order: 3;
    width: 100%;
    justify-content: center;
    border-top: 1px solid var(--border-color);
    padding-top: var(--space-sm);
  }

  .nav-tab span {
    display: none;
  }

  .nav-tab {
    padding: var(--space-sm) var(--space-md);
  }

  .app-main {
    padding: var(--space-md);
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
}

@media (max-width: 480px) {
  .app-main {
    padding: var(--space-sm);
  }

  .login-container {
    padding: var(--space-lg) var(--space-md);
  }
}
