@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --primary: #39A900;
  --primary-light: #4DC800;
  --primary-dark: #2d8200;
  --secondary: #FF6C00;
  --bg-color: #f0f4f8;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --success: #39A900;
  --border-color: #e2e8f0;
  --sidebar-width: 260px;
  --glass: rgba(255,255,255,0.7);
  --glass-border: rgba(255,255,255,0.9);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body {
  background: #f0f4f8;
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

/* --- Fondo Global --- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% -10%, rgba(57,169,0,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 70% 50% at 80% 110%, rgba(255,108,0,0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}


.mobile-logo {
  height: 40px;
}

h1 {
  font-size: 2.2rem;
  font-weight: 900;
  margin-bottom: 2rem;
  text-align: center;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: -0.5px;
}

.container {
  max-width: 1200px;
  width: 100%;
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 28px;
  padding: 2rem;
  box-shadow: 0 4px 24px -4px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
  position: relative;
  z-index: 1;
}

.icon {
  width: 1.2rem;
  height: 1.2rem;
  margin-right: 0.5rem;
  display: inline-block;
  vertical-align: middle;
}

/* --- Spinner de Carga --- */
.loader {
  border: 3px solid var(--border-color);
  border-left-color: var(--primary);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  animation: spin 0.8s linear infinite;
  margin: 2rem auto;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

@media (max-width: 768px) {
  body:not(.admin-layout) {
    padding: 1rem;
  }
  .container {
    padding: 1.5rem;
  }
  h1 {
    font-size: 1.8rem;
  }
}

/* --- Modal de Autenticación --- */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.4s ease;
}

.auth-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.auth-modal {
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(255,255,255,0.5);
  padding: 3rem 2.5rem;
  border-radius: 28px;
  text-align: center;
  max-width: 420px;
  width: 90%;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.3) inset,
    0 32px 64px -16px rgba(0, 0, 0, 0.35),
    0 8px 16px -4px rgba(0,0,0,0.1);
  transform: scale(1) translateY(0);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.auth-overlay.hidden .auth-modal {
  transform: scale(0.92) translateY(10px);
}

.auth-title {
  color: var(--primary);
  font-size: 1.9rem;
  margin-bottom: 0.5rem;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.auth-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.auth-input {
  width: 100%;
  padding: 0.9rem 1.2rem;
  border-radius: 14px;
  border: 1.5px solid var(--border-color);
  background: #f8fafc;
  font-size: 1rem;
  text-align: center;
  margin-bottom: 1rem;
  outline: none;
  transition: all 0.25s ease;
  letter-spacing: 2px;
  font-weight: 600;
  color: var(--text-main);
}

.auth-input:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(57, 169, 0, 0.12), 0 2px 8px rgba(57,169,0,0.1);
}

.auth-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  padding: 1rem;
  border-radius: 14px;
  border: none;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: 0 4px 15px -3px rgba(57,169,0,0.4);
}

.auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px -5px rgba(57, 169, 0, 0.5);
  filter: brightness(1.05);
}

.auth-btn:active {
  transform: translateY(0);
}

.auth-error {
  color: #ef4444;
  font-size: 0.88rem;
  margin-top: 1rem;
  font-weight: 600;
  display: none;
  background: rgba(239,68,68,0.08);
  padding: 0.6rem 1rem;
  border-radius: 8px;
}
