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

body {
  min-height: 100vh;
  font-family: "Sora", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 14%, rgba(45, 212, 191, 0.10), transparent 0 240px),
    radial-gradient(circle at 84% 22%, rgba(59, 130, 246, 0.10), transparent 0 220px),
    radial-gradient(circle at 78% 80%, rgba(45, 212, 191, 0.08), transparent 0 180px),
    linear-gradient(180deg, #f8fafc 0%, #f4f6fb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* ── Shell ────────────────────────────────────── */
.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  width: 100vw;
  min-height: 100vh;
  border-radius: 0;
  overflow: hidden;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: none;
  backdrop-filter: blur(10px);
}

/* ── Panel izquierdo ──────────────────────────── */
.login-left {
  background: linear-gradient(160deg, #0d1f35 0%, #0a1628 55%, #071220 100%);
  color: #e8f3ff;
  display: flex;
  align-items: stretch;
  position: relative;
  overflow: hidden;
}

/* Decoracion de fondo sutil */
.login-left::before {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.10) 0%, transparent 70%);
  top: -80px;
  right: -80px;
  pointer-events: none;
}

.login-left::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
  bottom: 40px;
  left: -60px;
  pointer-events: none;
}

.login-left-inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 32px 20px;
  width: 100%;
  position: relative;
  z-index: 1;
}

.brand-logo {
  width: 116px;
  display: block;
}

.login-left-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 0 2px;
}

.news-carousel {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid rgba(125, 168, 201, 0.16);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(11, 28, 47, 0.92) 0%, rgba(6, 19, 32, 0.88) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.news-carousel-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.news-carousel-title {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #d8f2ff;
}

.news-carousel-meta {
  font-size: 0.69rem;
  color: #7da8c9;
  line-height: 1.5;
}

.news-slides {
  position: relative;
  min-height: 166px;
}

.news-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.news-slide.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.news-tag {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(45, 212, 191, 0.12);
  color: #7ef0d5;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.news-slide h3 {
  font-size: 0.98rem;
  line-height: 1.3;
  color: #f0f8ff;
  margin-bottom: 10px;
}

.news-slide p {
  font-size: 0.78rem;
  line-height: 1.48;
  color: #9fc1da;
  margin-bottom: 10px;
}

.news-source {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.73rem;
  font-weight: 600;
  color: #7dd3fc;
  text-decoration: none;
}

.news-source:hover {
  color: #bae6fd;
}

.news-carousel-footer {
  display: grid;
  gap: 8px;
}

.news-dots {
  display: flex;
  gap: 8px;
}

.news-dot {
  width: 10px;
  height: 10px;
  border: none;
  border-radius: 999px;
  background: rgba(125, 168, 201, 0.3);
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}

.news-dot.is-active,
.news-dot:hover {
  background: #2dd4bf;
  transform: scale(1.05);
}

.news-progress {
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(125, 168, 201, 0.16);
}

.news-progress span {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg, #2dd4bf 0%, #7dd3fc 100%);
}

.market-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 10px;
}

.market-card {
  display: grid;
  gap: 4px;
  padding: 10px 12px 10px;
  border-radius: 18px;
  text-decoration: none;
  border: 1px solid rgba(125, 168, 201, 0.14);
  background: rgba(7, 21, 36, 0.72);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.market-card:hover {
  transform: translateY(-1px);
  border-color: rgba(125, 211, 252, 0.35);
  background: rgba(10, 28, 47, 0.88);
}

.market-card-name {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7da8c9;
}

.market-card strong {
  font-family: "Rajdhani", sans-serif;
  font-size: 1.35rem;
  line-height: 1;
}

.market-card-period {
  font-size: 0.71rem;
  color: #d3e6f6;
}

.market-card-trend {
  font-size: 0.72rem;
  color: #8eb4cf;
}

.market-card-neutral strong {
  color: #f8fafc;
}

.market-card-positive strong {
  color: #72f1c8;
}

/* ── Panel derecho ────────────────────────────── */
.login-right {
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 48px;
}

.login-form-wrap {
  width: 100%;
  max-width: 520px;
}

h1 {
  font-family: "Sora", sans-serif;
  font-size: clamp(1.45rem, 2.3vw, 1.85rem);
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
}

.login-desc {
  font-size: 0.82rem;
  color: #64748b;
  margin-bottom: 22px;
}

/* Form */
.login-form {
  display: grid;
  gap: 14px;
}

.field-group {
  display: grid;
  gap: 6px;
}

label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #334155;
}

input,
select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #dbe3ee;
  background: #f8fafc;
  color: #0f172a;
  padding: 11px 13px;
  font-size: 0.88rem;
  font-family: "Sora", sans-serif;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

input::placeholder {
  color: #94a3b8;
}

input:focus,
select:focus {
  border-color: #06b6d4;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  padding-right: 44px;
}

.login-select-wrap {
  position: relative;
}

.login-select-wrap::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(241, 245, 249, 0.9) 100%);
  pointer-events: none;
}

.login-select-wrap select {
  position: relative;
  z-index: 1;
  background: transparent;
}

.login-select-wrap:focus-within select {
  transform: translateY(-1px);
}

.login-select-icon {
  position: absolute;
  top: 50%;
  right: 14px;
  z-index: 2;
  width: 18px;
  height: 18px;
  color: #64748b;
  transform: translateY(-50%);
  pointer-events: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.login-select-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.login-select-wrap:focus-within .login-select-icon {
  color: #0891b2;
  transform: translateY(-50%) scale(1.05);
}

button[type="submit"] {
  margin-top: 6px;
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 12px 14px;
  font-family: "Sora", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  background: #0f172a;
  transition: background 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25);
}

button[type="submit"]:hover {
  background: #1e293b;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.32);
}

/* Alertas */
.alert {
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.86rem;
  margin-bottom: 16px;
}

.alert.error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}

.alert.success {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #166534;
}

/* Footnote */
.footnote {
  margin-top: 18px;
  font-size: 0.82rem;
  color: #94a3b8;
  text-align: right;
}

.footnote a {
  color: #64748b;
  text-decoration: none;
}

.footnote a:hover {
  color: #0f172a;
  text-decoration: underline;
}

/* Logo móvil y KPIs móvil: ocultos en desktop */
.brand-logo-mobile {
  display: none;
}

.market-strip-mobile {
  display: none;
}

.otp-shell {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.otp-panel {
  width: min(100%, 390px);
  display: grid;
  gap: 12px;
  padding: 24px 28px 24px;
  border: 1px solid #dbe3ee;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  text-align: center;
}

.otp-logo {
  width: 150px;
  margin: 0 auto 0;
  display: block;
}

.otp-spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto;
  position: relative;
}

.otp-spinner span {
  position: absolute;
  left: 19px;
  top: 3px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #0f172a;
  transform-origin: 3px 19px;
}

.otp-spinner span:nth-child(1) { transform: rotate(0deg); opacity: 1; }
.otp-spinner span:nth-child(2) { transform: rotate(60deg); opacity: 0.86; }
.otp-spinner span:nth-child(3) { transform: rotate(120deg); opacity: 0.72; }
.otp-spinner span:nth-child(4) { transform: rotate(180deg); opacity: 0.58; }
.otp-spinner span:nth-child(5) { transform: rotate(240deg); opacity: 0.44; }
.otp-spinner span:nth-child(6) { transform: rotate(300deg); opacity: 0.30; }

.otp-panel h1 {
  color: #0f172a;
  font-size: 1.38rem;
  margin-bottom: -4px;
}

.otp-panel .login-desc {
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.45;
  margin-bottom: 0;
}

.otp-phone {
  width: 100%;
  padding: 13px 15px;
  border-radius: 9px;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: left;
}

.otp-form {
  gap: 10px;
}

.verification-channel-group {
  border: 0;
  margin: 0;
  padding: 0;
}

.verification-channel-group legend {
  margin-bottom: 8px;
  font-size: 0.82rem;
  font-weight: 600;
}

.verification-channel-options,
.otp-channel-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.verification-channel-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid #ddd6fe;
  border-radius: 10px;
  cursor: pointer;
}

.verification-channel-option:has(input:checked) {
  border-color: #7c3aed;
  background: #f5f3ff;
  color: #6d28d9;
}

.verification-channel-option input {
  width: auto;
  margin: 0;
  accent-color: #7c3aed;
}

.otp-form button.otp-channel-action { width: 100%; margin: 8px 0 0; padding: 8px 12px; border: 1px solid #ddd6fe; background: #ffffff; color: #7c3aed; font-size: 0.74rem; box-shadow: none; }
.otp-form button.otp-channel-action:hover { background: #f5f3ff; color: #6d28d9; box-shadow: none; }

.otp-panel label {
  color: #334155;
}

.otp-panel input {
  background: #f8fafc;
  border-color: #dbe3ee;
  color: #0f172a;
  padding: 10px 12px;
}

.otp-panel input::placeholder {
  color: #94a3b8;
}

.otp-panel input:focus {
  background: #ffffff;
  border-color: #06b6d4;
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

.otp-panel #code {
  text-align: center;
  font-family: "Rajdhani", "Sora", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  padding-left: 14px;
}

.trusted-device-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: #0f172a;
  font-size: 0.80rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.35;
  text-align: left;
  text-transform: none;
  cursor: pointer;
}

.trusted-device-option input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  padding: 0;
  accent-color: #7c3aed;
  cursor: pointer;
}

.otp-resend-form {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-size: 0.80rem;
}

.otp-resend-form button {
  border: none;
  width: auto;
  margin: 0;
  padding: 5px 12px;
  border-radius: 8px;
  background: #ffffff;
  color: #7c3aed;
  font-family: "Sora", sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
}

.otp-resend-form button:hover {
  background: #7c3aed;
  color: #f97316;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(124, 58, 237, 0.24);
  text-decoration: none;
}

.otp-back-link:hover {
  color: #6d28d9;
  text-decoration: underline;
}

.otp-back-link {
  color: #7c3aed;
  font-size: 0.80rem;
  font-weight: 700;
  text-decoration: none;
}

.swal2-popup {
  width: min(92vw, 330px);
  padding: 1.05rem 1.15rem;
}

.swal2-title {
  font-size: 0.95rem;
  line-height: 1.35;
}

.swal2-icon {
  margin: 0.25em auto -0.25em;
  transform: scale(0.72);
  transform-origin: center;
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 768px) {
  body {
    padding: 0;
    align-items: stretch;
    background: linear-gradient(160deg, #0d1f35 0%, #0a1628 55%, #071220 100%);
  }

  .login-shell {
    grid-template-columns: 1fr;
    min-height: 100vh;
    border-radius: 0;
    width: 100%;
    border: none;
    box-shadow: none;
    background: transparent;
  }

  /* Ocultar panel izquierdo */
  .login-left {
    display: none;
  }

  /* Panel derecho: ocupa toda la pantalla con fondo oscuro Konecto */
  .login-right {
    background: transparent;
    padding: 52px 24px 40px;
    align-items: center;
  }

  .login-form-wrap {
    max-width: 100%;
    text-align: center;
    width: 100%;
  }

  .login-form,
  .field-group,
  .market-strip-mobile {
    text-align: left;
  }

  /* Títulos en modo oscuro */
  h1 {
    color: #f0f8ff;
  }

  .login-desc {
    color: #7da8c9;
  }

  /* Logo blanco sobre fondo oscuro */
  .brand-logo-mobile {
    display: block;
    width: 110px;
    margin: 0 auto 24px;
  }

  /* Labels e inputs en tema oscuro */
  label {
    color: #7da8c9;
  }

  input,
  select {
    background: rgba(11, 28, 47, 0.80);
    border-color: rgba(125, 168, 201, 0.22);
    color: #e8f3ff;
  }

  input::placeholder {
    color: rgba(125, 168, 201, 0.5);
  }

  input:focus,
  select:focus {
    background: rgba(11, 28, 47, 0.95);
    border-color: #2dd4bf;
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.15);
  }

  .login-select-wrap::before {
    background: linear-gradient(180deg, rgba(15, 32, 52, 0.72) 0%, rgba(10, 24, 39, 0.84) 100%);
  }

  .login-select-icon {
    color: #7da8c9;
  }

  .login-select-wrap:focus-within .login-select-icon {
    color: #5eead4;
  }

  /* Botón con acento teal Konecto */
  button[type="submit"] {
    background: linear-gradient(135deg, #2dd4bf 0%, #06b6d4 100%);
    color: #071220;
    font-weight: 700;
    box-shadow: 0 4px 18px rgba(45, 212, 191, 0.30);
  }

  button[type="submit"]:hover {
    background: linear-gradient(135deg, #5eead4 0%, #38bdf8 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(45, 212, 191, 0.40);
  }

  /* KPIs debajo del botón — estilo oscuro Konecto */
  .market-strip-mobile {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 24px;
  }

  .market-strip-mobile .market-card {
    background: rgba(7, 21, 36, 0.72);
    border-color: rgba(125, 168, 201, 0.14);
    border-radius: 16px;
    padding: 12px 13px;
  }

  .market-strip-mobile .market-card:hover {
    background: rgba(10, 28, 47, 0.90);
    border-color: rgba(125, 211, 252, 0.30);
    transform: translateY(-1px);
  }

  .market-strip-mobile .market-card-name {
    color: #7da8c9;
  }

  .market-strip-mobile .market-card strong {
    font-size: 1.18rem;
    color: #f0f8ff;
  }

  .market-strip-mobile .market-card-neutral strong {
    color: #f8fafc;
  }

  .market-strip-mobile .market-card-positive strong {
    color: #72f1c8;
  }

  .market-strip-mobile .market-card-period {
    color: #d3e6f6;
  }

  .market-strip-mobile .market-card-trend {
    color: #8eb4cf;
  }

  .otp-shell {
    padding: 20px;
    align-items: center;
  }

  .otp-panel {
    padding: 22px 20px;
    border-color: #dbe3ee;
    background: #ffffff;
  }

  .otp-panel h1 {
    color: #0f172a;
  }

  .otp-panel .login-desc {
    color: #64748b;
  }

  .otp-panel label {
    color: #334155;
  }

  .otp-panel input {
    background: #f8fafc;
    border-color: #dbe3ee;
    color: #0f172a;
  }

  .otp-panel input:focus {
    background: #ffffff;
    border-color: #06b6d4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
  }

  .trusted-device-option {
    color: #0f172a;
  }
}
