/* =====================================================
   Sky Balloons Connect — Hoja de Estilos Unificada v5
   Mobile-first + Desktop optimizado
   ===================================================== */

:root {
  --sbc-sky: #0099FF;
  --sbc-deep: #0056B3;
  --sbc-deepest: #04316b;
  --sbc-orange: #FF8C00;
  --sbc-yellow: #FFD54A;
  --sbc-white: #FFFFFF;
  --sbc-bg: #F5F7FA;
  --sbc-border: #D6DCE5;
  --sbc-muted: #6B7480;
  --sbc-dark: #343A40;
  --sbc-ink: #0B1F3A;
  --sbc-success: #28A745;
  --sbc-warning: #FFC107;
  --sbc-danger:  #DC3545;
  --sbc-info:    #17A2B8;

  --font-display: 'Poppins', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  --shadow-sm: 0 1px 2px rgba(11,31,58,.06), 0 1px 3px rgba(11,31,58,.04);
  --shadow-md: 0 6px 16px -4px rgba(11,31,58,.10), 0 2px 6px rgba(11,31,58,.06);
  --shadow-lg: 0 24px 60px -20px rgba(11,31,58,.25), 0 8px 20px -8px rgba(11,31,58,.12);
  --shadow-glow: 0 0 0 4px rgba(0,153,255,.15);
  --shadow-orange: 0 10px 24px -10px rgba(255,140,0,.55);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;

  --ease: cubic-bezier(.2,.7,.2,1);
  --ease-bounce: cubic-bezier(.34,1.56,.64,1);
  --ease-out-cubic: cubic-bezier(0.33, 1, 0.68, 1);

  --sidebar-w: 272px;
  --topbar-h: 64px;

  --bs-primary: var(--sbc-deep);
  --bs-primary-rgb: 0,86,179;
  --bs-body-font-family: var(--font-body);
  --bs-body-color: var(--sbc-ink);
  --bs-body-bg: var(--sbc-bg);
  --bs-border-color: var(--sbc-border);
  --bs-border-radius: var(--r-md);
}

*, *::before, *::after { box-sizing: border-box; }
* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

html { height: 100%; scroll-behavior: smooth; }
body {
  height: 100%;
  font-family: var(--font-body);
  color: var(--sbc-ink);
  background-color: var(--sbc-bg);
  letter-spacing: -0.005em;
  line-height: 1.55;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--sbc-ink);
  line-height: 1.15;
}

a { color: var(--sbc-deep); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--sbc-sky); }

img, svg { max-width: 100%; height: auto; display: block; }

:focus-visible { outline: 2px solid var(--sbc-sky); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ========== BOTONES ========== */
.btn {
  font-family: var(--font-display);
  font-weight: 500;
  border-radius: var(--r-md);
  padding: .72rem 1.15rem;
  letter-spacing: .005em;
  transition: transform .25s var(--ease-bounce), box-shadow .25s var(--ease), background-color .2s var(--ease), color .2s var(--ease);
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  position: relative;
  overflow: hidden;
}
.btn:focus-visible { box-shadow: var(--shadow-glow); outline: none; }
.btn:active { transform: scale(.96); }

.btn-accent {
  background: linear-gradient(135deg, #FF8C00, #FF6A00);
  border: none;
  color: #fff;
  box-shadow: var(--shadow-orange);
}
.btn-accent:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 14px 28px -10px rgba(255,140,0,.65); }

/* ========== FORMULARIOS ========== */
.form-control, .form-select {
  min-height: 48px;
  border-radius: var(--r-md);
  border: 1px solid var(--sbc-border);
  background-color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: .7rem .9rem;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease);
  width: 100%;
}
.form-control:focus, .form-select:focus {
  border-color: var(--sbc-sky);
  box-shadow: 0 0 0 4px rgba(0,153,255,.18);
}
.form-label {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: .88rem;
  color: var(--sbc-dark);
  margin-bottom: .35rem;
  display: block;
}

/* ========== PRELOADER ========== */
#sbc-preloader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  opacity: 1;
  visibility: visible;
}
#sbc-preloader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader-content { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; }
.preloader-logo { width: 80px; height: 80px; object-fit: contain; animation: preloader-pulse 2s ease-in-out infinite; }
.preloader-ring { width: 48px; height: 48px; border-radius: 50%; border: 3px solid var(--sbc-border); border-top-color: var(--sbc-deep); animation: sbc-spin 0.8s linear infinite; }

@keyframes preloader-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes sbc-spin { to { transform: rotate(360deg); } }

/* ========== AUTH LAYOUT (mobile-first) ========== */
.auth-shell {
  min-height: 100vh; min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
}

.auth-hero {
  position: relative;
  display: flex;
  color: #fff;
  background:
    radial-gradient(1200px 600px at 10% 10%, rgba(0,153,255,.35), transparent 60%),
    radial-gradient(900px 500px at 90% 90%, rgba(255,140,0,.18), transparent 60%),
    linear-gradient(160deg, #021a3a 0%, #0056B3 60%, #0099FF 130%);
  overflow: hidden;
  padding: 2.5rem 1.5rem;
  min-height: 280px;
  order: 1;
}
.auth-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: .35;
  pointer-events: none;
}
.hero-inner { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: space-between; z-index: 2; width: 100%; }

/* Logo y marca */
.brand-logo { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem; }
.brand-logo-img {
  width: 56px; height: 56px;
  background: #fff;
  border-radius: 14px;
  padding: 6px;
  object-fit: contain;
}
.brand-title { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; line-height: 1.1; }
.brand-subtitle { letter-spacing: .14em; text-transform: uppercase; font-size: .7rem; opacity: .7; }

.auth-hero h1 {
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 4vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -.03em;
}
.auth-hero h1 .accent { color: var(--sbc-yellow); }
.auth-hero p.lead { color: rgba(255,255,255,.78); font-size: clamp(.9rem, 2vw, 1.05rem); max-width: 36ch; }

.hero-card {
  margin-top: 1.5rem;
  padding: 1.25rem 1.4rem;
  border-radius: var(--r-lg);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.hero-card small { color: rgba(255,255,255,.65); text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; }
.hero-stats { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.stat-value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; }
.hero-footer { opacity: .55; font-size: .78rem; margin-top: 1.2rem; }

/* Globo decorativo */
.floating-balloon {
  position: absolute;
  right: -40px; bottom: -40px;
  width: 320px; max-width: 65%;
  opacity: .35;
  filter: drop-shadow(0 30px 40px rgba(0,0,0,.4));
  animation: floaty 9s ease-in-out infinite;
  pointer-events: none;
}
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-18px) rotate(2deg); } }

/* ========== CARRUSEL SWIPER (clase .hero-swiper) ========== */
.hero-swiper {
  width: 100%;
  margin-top: 1.8rem;
  border-radius: 1.2rem;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}
.hero-swiper .swiper-slide img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}
.hero-swiper .swiper-pagination-bullet { background: #fff; opacity: 0.6; }
.hero-swiper .swiper-pagination-bullet-active { background: var(--sbc-orange); opacity: 1; }
.hero-swiper .swiper-button-next,
.hero-swiper .swiper-button-prev {
  color: #fff;
  background: rgba(0,0,0,0.25);
  width: 2.2rem; height: 2.2rem;
  border-radius: 50%;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.hero-swiper .swiper-button-next::after,
.hero-swiper .swiper-button-prev::after { font-size: 1.2rem; font-weight: 700; }
.hero-swiper .swiper-button-next:hover,
.hero-swiper .swiper-button-prev:hover { background: rgba(0,0,0,0.45); }

@media (max-width: 992px) {
  .hero-swiper { max-width: 90%; margin-left: auto; margin-right: auto; }
}

/* ========== PANEL DEL FORMULARIO ========== */
.auth-pane {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  background: var(--sbc-bg);
  order: 2;
}
.auth-card {
  width: 100%; max-width: 460px;
  background: #fff;
  border: 1px solid var(--sbc-border);
  border-radius: var(--r-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
}
.brand-row { display: flex; align-items: center; justify-content: center; margin-bottom: 1.25rem; }
.brand-row img { width: 72px; height: 72px; object-fit: contain; }
.auth-card h2 { font-size: 1.5rem; margin-bottom: .25rem; }
.auth-card .subtitle { color: var(--sbc-muted); font-size: .9rem; margin-bottom: 1.25rem; }
.auth-divider { display: flex; align-items: center; gap: .75rem; color: var(--sbc-muted); font-size: .8rem; margin: 1.25rem 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--sbc-border); }

/* ========== RESPONSIVE: tablet+ (2 columnas) ========== */
@media (min-width: 768px) {
  .auth-shell { grid-template-columns: 1fr 1fr; }
  .auth-hero { order: 0; padding: 3rem; min-height: auto; }
  .floating-balloon { right: -60px; bottom: -60px; width: 480px; }
  .auth-pane { order: 0; padding: 2rem; }
  .auth-card { padding: 2.25rem; }
  .brand-row img { width: 88px; height: 88px; }
  .auth-card h2 { font-size: 1.65rem; }
}

@media (min-width: 1024px) {
  .auth-shell { grid-template-columns: 45fr 55fr; }
}


/* ========== Intl-tel-input – integración pulida ========== */
.iti {
    width: 100%;
    display: block;
}
.iti__flag-container {
    z-index: 5;
}
.iti__selected-flag {
    background: transparent !important;
    border-right: 1px solid var(--sbc-border);
    border-radius: var(--r-md) 0 0 var(--r-md);
    padding: 0 10px;
    transition: background 0.2s ease;
}
.iti__selected-flag:hover {
    background: rgba(0,0,0,0.03) !important;
}
/* El input que genera la librería */
.iti input {
    width: 100% !important;
    height: 48px;
    border: 1px solid var(--sbc-border);
    border-radius: var(--r-md);
    padding: 0.7rem 0.9rem 0.7rem 52px; /* espacio para la bandera + código */
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--sbc-ink);
    background-color: #fff;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.iti input:focus {
    border-color: var(--sbc-sky);
    box-shadow: 0 0 0 4px rgba(0,153,255,.18);
    outline: none;
}
/* Ajuste del dropdown de países */
.iti__country-list {
    border-radius: var(--r-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--sbc-border);
    font-family: var(--font-body);
}
.iti__arrow {
    border-top-color: var(--sbc-muted);
}
/* Alinear correctamente el código de país cuando hay separateDialCode */
.iti--separate-dial-code .iti__selected-dial-code {
    font-size: 0.95rem;
    color: var(--sbc-ink);
}
/* Quitar borde extra que a veces aparece */
.iti input.form-control {
    border: 1px solid var(--sbc-border); /* sobreescribe cualquier borde doble */
}