/* ============================================================================
   Cobro Express Lite — Estilos custom (complemento de Tailwind)
   ============================================================================ */

:root {
  --primary:       #6366F1;
  --primary-dark:  #4F46E5;
  --primary-light: #818CF8;
  --secondary:     #10B981;
  --carton-bg:     #FFF9B9;
  --carton-azul:   #004C70;
  --warning:       #F97316;
  --error:         #EF4444;
}

* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  background: #f8fafc;
}

/* ── Anti-FOUC: oculta el contenido hasta que Tailwind cargue ──────────── */
html:not(.tailwind-ready) body { visibility: hidden; }
html.tailwind-ready body      { visibility: visible; animation: fadeIn 0.25s ease-out; }

/* ── Animaciones de entrada ─────────────────────────────────────────────── */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.3s ease-out both; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.slide-up { animation: slideUp 0.4s ease-out both; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
.float { animation: float 4s ease-in-out infinite; }

@keyframes pulse-slow {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50%      { opacity: 0.7;  transform: scale(1.05); }
}
.pulse-slow { animation: pulse-slow 3s ease-in-out infinite; }

/* ── Gradientes / fondos ────────────────────────────────────────────────── */

.bg-hero {
  background:
    radial-gradient(circle at 20% 20%, rgba(129, 140, 248, 0.25) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(99, 102, 241, 0.20) 0%, transparent 50%),
    linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
}

.bg-mesh {
  background:
    radial-gradient(at 20% 30%, rgba(129, 140, 248, 0.15) 0px, transparent 50%),
    radial-gradient(at 80% 0%,  rgba(99, 102, 241, 0.10) 0px, transparent 50%),
    radial-gradient(at 0% 90%,  rgba(16, 185, 129, 0.08) 0px, transparent 50%),
    #f8fafc;
}

.text-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.45);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }

/* ── Inputs custom ──────────────────────────────────────────────────────── */

.input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.input.error { border-color: var(--error); box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15); }

/* ── Password con ojito ──────────────────────────────────────────────────── */
.password-field {
  position: relative;
}
.password-field .input {
  padding-right: 44px;       /* espacio para el botón del ojo */
}
.password-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  padding: 8px;
  cursor: pointer;
  color: #9ca3af;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.password-toggle:hover { color: var(--primary); background: rgba(99,102,241,0.08); }
.password-toggle svg { width: 18px; height: 18px; display: block; }
.password-toggle .icon-show  { display: block; }
.password-toggle .icon-hide  { display: none; }
.password-toggle.is-visible .icon-show { display: none; }
.password-toggle.is-visible .icon-hide { display: block; }

/* ── Cartón estético (decorativo en landing) ────────────────────────────── */

.carton-mock {
  background: var(--carton-bg);
  border: 2px solid var(--carton-azul);
  border-radius: 14px;
  padding: 20px;
  font-family: "Courier New", monospace;
  color: var(--carton-azul);
  box-shadow: 0 12px 30px rgba(0, 76, 112, 0.18);
}

/* ── PIN inputs (6 cajitas separadas) ───────────────────────────────────── */

.pin-input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 24px;
  font-weight: bold;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-family: "Courier New", monospace;
  transition: all 0.15s;
}
.pin-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  transform: scale(1.05);
}

/* ── Loading overlay sofisticado ────────────────────────────────────────── */

.loading-overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.loading-overlay.show { opacity: 1; pointer-events: all; }

.loading-card {
  display: flex; flex-direction: column; align-items: center;
  padding: 24px;
  text-align: center;
  animation: slideUp 0.4s ease-out both;
}

.loading-spinner {
  position: relative;
  width: 140px; height: 140px;
  margin-bottom: 28px;
}

/* Anillo exterior rotando con gradiente */
.loading-spinner::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0%, var(--primary) 50%, transparent 100%);
  -webkit-mask: radial-gradient(circle, transparent 56%, black 58%, black 70%, transparent 72%);
          mask: radial-gradient(circle, transparent 56%, black 58%, black 70%, transparent 72%);
  animation: spin-cw 1.5s linear infinite;
}

/* Anillo medio con puntos rotando al revés */
.loading-spinner::after {
  content: "";
  position: absolute; inset: 16px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 0%,    var(--primary-light) 0 3px, transparent 4px),
    radial-gradient(circle at 100% 50%,  var(--primary-light) 0 3px, transparent 4px),
    radial-gradient(circle at 50% 100%,  var(--primary-light) 0 3px, transparent 4px),
    radial-gradient(circle at 0% 50%,    var(--primary-light) 0 3px, transparent 4px);
  opacity: 0.7;
  animation: spin-ccw 3s linear infinite;
}

/* Logo en el centro pulsando */
.loading-logo {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 64px; height: 64px;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
  animation: logo-pulse 1.4s ease-in-out infinite;
}

.loading-text {
  font-size: 15px;
  font-weight: 600;
  color: #1e1b4b;
  letter-spacing: 0.2px;
  margin: 0 0 6px;
}
.loading-subtext {
  font-size: 12px;
  color: #6b7280;
  margin: 0;
  animation: text-cycle 0.4s ease-out;
}

@keyframes spin-cw   { to { transform: rotate(360deg); } }
@keyframes spin-ccw  { to { transform: rotate(-360deg); } }
@keyframes logo-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1);    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4); }
  50%      { transform: translate(-50%, -50%) scale(1.06); box-shadow: 0 12px 36px rgba(99, 102, 241, 0.6); }
}
@keyframes text-cycle {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Scrollbar suave ────────────────────────────────────────────────────── */

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #f3f4f6; }
::-webkit-scrollbar-thumb { background: #c7d2fe; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #a5b4fc; }
