:root {
  --bg: #07090e;
  --card-bg: rgba(16, 22, 34, 0.78);
  --card-border: rgba(56, 189, 248, 0.15);
  --input-bg: #0b0f19;
  --input-border: rgba(255, 255, 255, 0.12);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --cyan: #06b6d4;
  --cyan-glow: rgba(6, 182, 212, 0.35);
  --blue: #3b82f6;
  --emerald: #10b981;
  --amber: #f59e0b;
  --rose: #f43f5e;
  --purple: #a855f7;
}

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

body {
  background-color: var(--bg);
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(6, 182, 212, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 90% 90%, rgba(59, 130, 246, 0.08) 0%, transparent 45%);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

/* Navbar */
.navbar {
  background: rgba(11, 15, 25, 0.85);
  border-bottom: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.85rem 1.5rem;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 15px var(--cyan-glow);
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.project-banner-box {
  width: 100%;
  max-width: 980px;
  margin: 0 auto 2rem auto;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5), 0 0 30px rgba(6, 182, 212, 0.15);
  background: #0d121d;
  display: flex;
  justify-content: center;
  align-items: center;
}

.project-banner-img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  object-position: center;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  color: #fff;
  letter-spacing: -0.01em;
}

.brand-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.08em;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
}

.nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s;
}

.nav-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
  color: #38bdf8;
  background: rgba(6, 182, 212, 0.12);
  border-color: rgba(6, 182, 212, 0.25);
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.35rem 0.8rem;
  border-radius: 9999px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}

.status-dot.offline {
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
}

/* Main Content */
.main-content {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.hero-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.hero-header h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
  background: linear-gradient(135deg, #ffffff 40%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 700px;
  margin: 0 auto;
}

/* Grid */
.audit-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 1.75rem;
  margin-bottom: 2rem;
}

@media (max-width: 900px) {
  .audit-grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 2rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.4);
}

.card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 0.75rem;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 0.4rem;
}

input, textarea, select {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: #fff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.9rem;
  transition: all 0.2s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 10px var(--cyan-glow);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  margin-top: 0.3rem;
}

.engine-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.2rem;
  margin-bottom: 1.5rem;
}

.engine-header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.submit-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  border: none;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.9rem 1.5rem;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px var(--cyan-glow);
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(6, 182, 212, 0.5);
}

.submit-btn:active {
  transform: translateY(0);
}

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

/* Feature List */
.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.feature-list li {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.feature-icon {
  font-size: 1.3rem;
  background: rgba(255, 255, 255, 0.04);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.feature-content strong {
  display: block;
  font-size: 0.9rem;
  color: #fff;
}

.feature-content p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.offline-badge-box {
  margin-top: 1.5rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.82rem;
  color: #fde68a;
}

.offline-icon {
  font-size: 1.4rem;
}

/* Result Container */
.result-card {
  margin-top: 2rem;
  padding: 1.5rem;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.result-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  color: #fff;
}

.result-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.result-actions {
  display: flex;
  gap: 0.75rem;
}

.action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.action-btn.btn-primary {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #000;
}

.iframe-wrapper {
  width: 100%;
  height: 800px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: #000;
}

.iframe-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* History Tab */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.section-header h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  color: #fff;
}

.section-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.history-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 1.25rem;
  transition: transform 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.history-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.4);
}

.history-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.4rem;
}

.history-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.history-actions {
  display: flex;
  gap: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.75rem;
}

/* Guide Tab */
.guide-card {
  padding: 2.5rem;
}

.guide-card h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: #fff;
}

.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.guide-step {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 1.5rem;
}

.guide-step h3 {
  font-family: 'Outfit', sans-serif;
  color: var(--cyan);
  margin-bottom: 0.75rem;
}

.guide-step ol, .guide-step ul {
  padding-left: 1.5rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 0.5rem;
}

.guide-step li {
  margin-bottom: 0.4rem;
}

code {
  background: #0d1117;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  color: #38bdf8;
  font-size: 0.85rem;
}

/* ==========================================================================
   FIREBASE AUTH GATE (ACCESO EXCLUSIVO GOOGLE)
   ========================================================================== */

#auth-gate-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, rgba(14, 22, 38, 0.97) 0%, rgba(5, 7, 13, 0.99) 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

#auth-gate-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-gate-card {
  background: rgba(16, 23, 38, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 35px rgba(6, 182, 212, 0.2);
  border-radius: 20px;
  max-width: 480px;
  width: 100%;
  padding: 2.5rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: cardPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardPop {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.auth-gate-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--cyan), var(--blue), var(--purple));
}

.auth-gate-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  margin: 0 auto 1.25rem auto;
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 20px var(--cyan-glow);
  overflow: hidden;
  background: #000;
}

.auth-gate-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.auth-gate-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  margin-bottom: 1rem;
}

.auth-gate-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.75rem;
  line-height: 1.25;
}

.auth-gate-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 2rem;
}

.btn-google-auth-gate {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: #ffffff;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  padding: 0.85rem 1.5rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-google-auth-gate:hover {
  background: #f8fafc;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 255, 255, 0.15);
}

.btn-google-auth-gate:active {
  transform: translateY(0);
}

.auth-gate-security-pills {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-security-pill {
  font-size: 0.72rem;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.app-locked {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
}

