/* ============================================================
   PANA CLICK · VERIFICACIÓN DE CÓDIGOS — THEME v1.0
   Dark premium design with glassmorphism & micro-animations
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700&display=swap');

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

/* ===== DESIGN TOKENS ===== */
:root {
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Space Grotesk', sans-serif;

  --bg-0: #030509;
  --bg-1: #070b14;
  --bg-2: #0c1222;
  --bg-3: #111a2e;
  --bg-card: rgba(10, 16, 30, 0.82);
  --bg-glass: rgba(255,255,255, 0.025);
  --bg-input: rgba(0,0,0, 0.45);

  --line: rgba(255,255,255, 0.08);
  --line-soft: rgba(255,255,255, 0.05);
  --line-blue: rgba(59,130,246, 0.3);

  --text-1: #ffffff;
  --text-2: rgba(255,255,255, 0.62);
  --text-3: rgba(255,255,255, 0.35);
  --text-4: rgba(255,255,255, 0.16);

  --blue: #3b82f6;
  --blue-hi: #60a5fa;
  --blue-dim: rgba(59,130,246, 0.12);
  --cyan: #06d6d4;
  --green: #22d88f;
  --green-dim: rgba(34,216,143, 0.12);
  --amber: #fbbf24;
  --amber-dim: rgba(251,191,36, 0.12);
  --red: #f43f5e;
  --red-dim: rgba(244,63,94, 0.12);
  --gold: #d4a843;
  --gold-dim: rgba(212,168,67, 0.15);

  --r: 18px;
  --r-sm: 12px;
  --r-xs: 8px;
  --shadow: 0 24px 64px rgba(0,0,0, 0.55);
  --shadow-glow: 0 0 60px rgba(59,130,246, 0.08);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== BASE ===== */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-0);
  color: var(--text-1);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: var(--blue-hi); text-decoration: none; }
a:hover { color: #93c5fd; }

/* ===== BACKGROUND DECORATION ===== */
.bg-decoration {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.bg-orb {
  position: absolute; border-radius: 50%; filter: blur(120px); opacity: 0.35;
}
.bg-orb-1 {
  width: 600px; height: 600px; top: -200px; right: -150px;
  background: radial-gradient(circle, rgba(59,130,246,0.18), transparent 70%);
  animation: orbFloat 18s ease-in-out infinite;
}
.bg-orb-2 {
  width: 500px; height: 500px; bottom: -180px; left: -120px;
  background: radial-gradient(circle, rgba(6,214,212,0.12), transparent 70%);
  animation: orbFloat 22s ease-in-out infinite reverse;
}
.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 20%, transparent 100%);
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 15px) scale(0.95); }
}

/* ===== HEADER ===== */
.header {
  position: relative; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 30px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(3,5,9, 0.6);
  backdrop-filter: blur(20px);
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-size: 1.3rem; font-weight: 700;
  color: #fff; text-decoration: none;
}
.logo img { width: 32px; height: 32px; border-radius: 8px; }
.logo b {
  background: linear-gradient(120deg, var(--blue), var(--cyan));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.admin-link {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--bg-glass); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 0.85rem;
  transition: all 0.3s var(--ease);
}
.admin-link:hover { color: var(--blue-hi); border-color: var(--line-blue); background: var(--blue-dim); }

/* ===== MAIN ===== */
.main {
  position: relative; z-index: 5;
  max-width: 780px; margin: 0 auto; padding: 40px 20px 60px;
}

/* ===== HERO ===== */
.hero { text-align: center; margin-bottom: 36px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 18px; border-radius: 100px;
  background: var(--blue-dim); border: 1px solid rgba(59,130,246,0.2);
  color: var(--blue-hi); font-size: 0.78rem; font-weight: 600;
  margin-bottom: 18px;
  animation: fadeInUp 0.6s var(--ease);
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 700; line-height: 1.15;
  background: linear-gradient(135deg, #fff 30%, rgba(255,255,255,0.6));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
  animation: fadeInUp 0.6s var(--ease) 0.1s both;
}
.hero-desc {
  color: var(--text-2); font-size: 1rem; max-width: 520px; margin: 0 auto;
  animation: fadeInUp 0.6s var(--ease) 0.2s both;
}

/* ===== SEARCH CARD ===== */
.search-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
  animation: fadeInUp 0.6s var(--ease) 0.3s both;
}
.search-input-wrap {
  display: flex; align-items: center; gap: 0;
  background: var(--bg-input);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  padding: 4px 4px 4px 16px;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.search-input-wrap:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(59,130,246,0.1);
}
.search-icon { color: var(--text-3); font-size: 1rem; flex-shrink: 0; }
.search-input {
  flex: 1; padding: 14px 12px;
  background: transparent; border: none; outline: none;
  color: #fff; font-family: var(--font-body); font-size: 0.95rem;
}
.search-input::placeholder { color: var(--text-4); }
.search-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 10px; border: none;
  background: linear-gradient(135deg, var(--blue), #2563eb);
  color: #fff; font-family: var(--font-body); font-size: 0.88rem; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  transition: all 0.3s var(--ease);
  box-shadow: 0 4px 16px rgba(59,130,246,0.3);
}
.search-btn:hover {
  background: linear-gradient(135deg, var(--blue-hi), var(--blue));
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(59,130,246,0.4);
}
.search-btn:active { transform: translateY(0); }
.search-btn.loading {
  pointer-events: none; opacity: 0.8;
}
.search-btn.loading i { animation: spin 0.8s linear infinite; }
.search-hint {
  display: flex; align-items: center; gap: 8px;
  margin-top: 14px; padding: 10px 14px;
  background: rgba(34,216,143,0.06);
  border: 1px solid rgba(34,216,143,0.15);
  border-radius: var(--r-xs);
  color: var(--green); font-size: 0.78rem; font-weight: 500;
}

/* ===== STATUS ===== */
.status {
  text-align: center; padding: 14px 18px; border-radius: var(--r-sm);
  font-size: 0.88rem; font-weight: 500; margin-bottom: 20px;
  animation: fadeIn 0.3s var(--ease);
}
.status.error {
  background: var(--red-dim); border: 1px solid rgba(244,63,94,0.25); color: var(--red);
}
.status.success {
  background: var(--green-dim); border: 1px solid rgba(34,216,143,0.25); color: var(--green);
}
.status.info {
  background: var(--blue-dim); border: 1px solid rgba(59,130,246,0.25); color: var(--blue-hi);
}

/* ===== CODE RESULT CARDS ===== */
.results { display: flex; flex-direction: column; gap: 12px; }

.code-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 18px 22px;
  transition: all 0.3s var(--ease);
  animation: fadeInUp 0.5s var(--ease) both;
}
.code-card:hover {
  border-color: rgba(255,255,255,0.1);
  background: rgba(12,18,32,0.95);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.code-card-info { flex: 1; min-width: 0; }
.code-card-sender {
  font-size: 0.92rem; font-weight: 600; color: #fff;
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 4px;
}
.code-card-sender .sender-email { color: var(--text-3); font-weight: 400; font-size: 0.82rem; }
.code-card-subject {
  font-size: 0.82rem; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}
.code-card-date {
  font-size: 0.72rem; color: var(--text-3); margin-top: 4px;
  font-family: 'SF Mono', 'Cascadia Code', monospace;
  letter-spacing: 0.02em;
}

/* Code Badge */
.code-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 10px;
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 700;
  letter-spacing: 0.08em;
  background: var(--gold-dim); border: 1px solid rgba(212,168,67,0.3);
  color: var(--gold);
  cursor: pointer;
  transition: all 0.25s var(--ease);
  flex-shrink: 0;
  position: relative;
}
.code-badge:hover {
  background: rgba(212,168,67,0.25);
  transform: scale(1.05);
}
.code-badge.copied {
  background: var(--green-dim) !important;
  border-color: rgba(34,216,143,0.3) !important;
  color: var(--green) !important;
}
.code-badge .copy-hint {
  position: absolute; bottom: -24px; left: 50%; transform: translateX(-50%);
  font-size: 0.65rem; color: var(--text-3); white-space: nowrap;
  opacity: 0; transition: opacity 0.2s;
}
.code-badge:hover .copy-hint { opacity: 1; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center; padding: 50px 20px;
  animation: fadeIn 0.5s var(--ease);
}
.empty-state i {
  font-size: 3rem; color: var(--text-4); margin-bottom: 16px;
}
.empty-state h3 {
  font-family: var(--font-display); font-size: 1.2rem;
  color: var(--text-2); margin-bottom: 8px;
}
.empty-state p { color: var(--text-3); font-size: 0.88rem; max-width: 380px; margin: 0 auto; }

/* ===== AUTO-REFRESH BAR ===== */
.refresh-bar {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 10px; margin-bottom: 16px;
  font-size: 0.8rem; color: var(--text-3);
  animation: fadeIn 0.3s;
}
.refresh-bar button {
  background: var(--bg-glass); border: 1px solid var(--line); border-radius: 8px;
  padding: 5px 12px; color: var(--blue-hi); font-size: 0.78rem;
  font-family: var(--font-body); font-weight: 600; cursor: pointer;
  transition: all 0.2s var(--ease);
}
.refresh-bar button:hover { background: var(--blue-dim); border-color: var(--line-blue); }

/* ===== LOADING SKELETON ===== */
.skeleton-card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 20px 22px;
  display: flex; align-items: center; gap: 16px;
}
.skeleton-line {
  height: 14px; border-radius: 6px;
  background: linear-gradient(90deg, var(--bg-glass), rgba(255,255,255,0.06), var(--bg-glass));
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w40 { width: 40%; }
.skeleton-line.w80 { width: 80%; }
.skeleton-badge {
  width: 80px; height: 40px; border-radius: 10px;
  background: linear-gradient(90deg, rgba(212,168,67,0.05), rgba(212,168,67,0.1), rgba(212,168,67,0.05));
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== FOOTER ===== */
.footer {
  position: relative; z-index: 5;
  text-align: center; padding: 30px 20px;
  color: var(--text-4); font-size: 0.78rem;
  border-top: 1px solid var(--line-soft);
}

/* ===== ADMIN PAGE ===== */
/* Login Screen */
.login-screen {
  position: fixed; inset: 0; z-index: 9000;
  background: var(--bg-0);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.login-box {
  width: 100%; max-width: 400px;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 22px; padding: 44px 36px;
  text-align: center; box-shadow: var(--shadow);
}
.login-box .login-icon {
  width: 64px; height: 64px; margin: 0 auto 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--blue-dim), rgba(6,214,212,0.08));
  border: 1px solid var(--line-blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; color: var(--blue-hi);
}
.login-box h2 {
  font-family: var(--font-display); font-size: 1.5rem; margin-bottom: 6px;
}
.login-box .login-desc {
  color: var(--text-2); font-size: 0.85rem; margin-bottom: 28px;
}

/* Admin Layout */
.admin-layout {
  display: flex; min-height: 100vh;
}
.admin-sidebar {
  width: 260px; flex-shrink: 0;
  background: var(--bg-2); border-right: 1px solid var(--line-soft);
  padding: 24px 0; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.admin-sidebar .logo { padding: 0 22px 28px; }
.admin-nav { list-style: none; flex: 1; }
.admin-nav a {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 22px; color: var(--text-2); text-decoration: none;
  font-size: 0.87rem; transition: all 0.25s var(--ease);
  border-left: 3px solid transparent; cursor: pointer;
}
.admin-nav a:hover { color: #fff; background: rgba(59,130,246,0.05); }
.admin-nav a.active {
  color: #fff; background: rgba(59,130,246,0.1);
  border-left-color: var(--blue);
}
.admin-nav a i { width: 20px; text-align: center; }

.admin-topbar {
  height: 66px; border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 30px; position: sticky; top: 0;
  background: rgba(7,11,20,0.85); backdrop-filter: blur(16px); z-index: 50;
}
.admin-topbar .t-title { color: var(--text-2); font-size: 0.92rem; }
.admin-main { flex: 1; overflow-y: auto; }
.admin-page { padding: 30px; }
.admin-page-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 14px;
}
.admin-page-title {
  font-family: var(--font-display); font-size: 1.7rem; font-weight: 700;
}

/* ===== SHARED COMPONENTS ===== */

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--r-sm); border: none;
  font-family: var(--font-body); font-size: 0.88rem; font-weight: 700;
  cursor: pointer; transition: all 0.3s var(--ease);
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--blue), #2563eb);
  color: #fff;
  box-shadow: 0 4px 16px rgba(59,130,246,0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--blue-hi), var(--blue));
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(59,130,246,0.4);
}
.btn-outline {
  background: transparent; border: 1px solid var(--line);
  color: var(--blue-hi);
}
.btn-outline:hover { background: var(--blue-dim); border-color: var(--line-blue); }
.btn-danger {
  background: var(--red-dim); border: 1px solid rgba(244,63,94,0.25);
  color: var(--red);
}
.btn-danger:hover { background: rgba(244,63,94,0.2); }
.btn-success {
  background: var(--green-dim); border: 1px solid rgba(34,216,143,0.25);
  color: var(--green);
}
.btn-sm { padding: 8px 14px; font-size: 0.8rem; border-radius: 9px; }

/* Form Fields */
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 0.8rem; color: var(--text-2); margin-bottom: 8px; font-weight: 500;
}
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px;
  background: var(--bg-input); border: 1px solid var(--line);
  border-radius: 10px; color: #fff;
  font-family: var(--font-body); font-size: 0.88rem; outline: none;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.field input:focus, .field select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.field input::placeholder { color: var(--text-4); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Cards */
.card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 26px;
}

/* Tables */
.tbl-wrap {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden;
}
.tbl-wrap table { width: 100%; border-collapse: collapse; }
.tbl-wrap th {
  padding: 14px 18px; font-size: 0.74rem; color: var(--text-3);
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 1px solid var(--line); background: rgba(0,0,0,0.25);
  text-align: left;
}
.tbl-wrap td {
  padding: 14px 18px; font-size: 0.85rem;
  border-bottom: 1px solid var(--line-soft);
}
.tbl-wrap tbody tr:hover td { background: rgba(255,255,255,0.02); }

/* Status Badges */
.badge {
  padding: 4px 12px; border-radius: 8px;
  font-size: 0.72rem; font-weight: 700; display: inline-flex; align-items: center; gap: 5px;
}
.badge-ok { background: var(--green-dim); color: var(--green); border: 1px solid rgba(34,216,143,0.2); }
.badge-warn { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(251,191,36,0.2); }
.badge-err { background: var(--red-dim); color: var(--red); border: 1px solid rgba(244,63,94,0.2); }
.badge-info { background: var(--blue-dim); color: var(--blue-hi); border: 1px solid rgba(59,130,246,0.2); }

/* Config Card */
.config-card {
  background: linear-gradient(135deg, rgba(59,130,246,0.06), rgba(6,214,212,0.03));
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: var(--r); padding: 24px; margin-bottom: 24px;
}
.config-card h3 {
  font-family: var(--font-display); font-size: 1.05rem;
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.config-card h3 .cfg-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; color: #fff;
}
.config-hint {
  font-size: 0.8rem; color: var(--text-2); line-height: 1.5;
  margin-bottom: 18px; background: rgba(0,0,0,0.2);
  padding: 12px 14px; border-radius: 10px;
  border-left: 3px solid var(--blue);
}

/* Toast Notifications */
.toast-wrap {
  position: fixed; top: 20px; right: 20px; z-index: 10000;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px; border-radius: var(--r-sm);
  font-size: 0.85rem; font-weight: 500;
  background: var(--bg-card); border: 1px solid var(--line);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  animation: slideInRight 0.4s var(--ease), fadeOut 0.4s var(--ease) 2.8s forwards;
  backdrop-filter: blur(16px);
}
.toast.ok { border-left: 3px solid var(--green); }
.toast.ok i { color: var(--green); }
.toast.err { border-left: 3px solid var(--red); }
.toast.err i { color: var(--red); }
.toast.info { border-left: 3px solid var(--blue); }
.toast.info i { color: var(--blue-hi); }

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
@keyframes codeGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(212,168,67,0.15); }
  50% { box-shadow: 0 0 20px rgba(212,168,67,0.3); }
}
.code-badge { animation: codeGlow 2.5s ease-in-out infinite; }

/* ===== RESPONSIVE ===== */
@media (max-width: 680px) {
  .header { padding: 16px 18px; }
  .main { padding: 28px 16px 50px; }
  .hero-title { font-size: 1.6rem; }
  .search-card { padding: 20px 16px; }
  .search-input-wrap { flex-wrap: wrap; padding: 4px; gap: 0; }
  .search-icon { display: none; }
  .search-input { padding: 12px; font-size: 0.9rem; min-width: 0; }
  .search-btn { width: 100%; justify-content: center; padding: 13px; margin-top: 2px; }
  .code-card { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; }
  .code-badge { align-self: flex-start; }
  .admin-sidebar { display: none; }
  .admin-page { padding: 18px 14px; }
  .admin-page-title { font-size: 1.35rem; }
  .row2 { grid-template-columns: 1fr; }
  .tbl-wrap { overflow-x: auto; }
  .tbl-wrap table { min-width: 500px; }
}
