@charset "UTF-8";

/* ==========================================================================
   CSS VARIABLES - DESIGN SYSTEM
   ========================================================================== */
:root {
  /* Color Palette */
  --color-canvas: #090909;
  --color-canvas-login: #050505;
  --color-surface-1: #141414;
  --color-surface-2: #1c1c1c;
  --color-hairline: #262626;
  --color-hairline-soft: #1a1a1a;
  
  --color-ink: #ffffff;
  --color-ink-muted: #999999;
  
  --color-accent-blue: #0099ff;
  --color-brand-magenta: #E6007E;
  --color-brand-blue: #001A70;
  
  --color-gradient-magenta: #d44df0;
  --color-gradient-violet: #6a4cf5;
  
  --color-success: #22c55e;
  --color-success-bg: rgba(34, 197, 94, 0.12);
  --color-error: #ef4444;
  --color-error-bg: rgba(239, 68, 68, 0.12);
  --color-warning: #f59e0b;
  --color-warning-bg: rgba(245, 158, 11, 0.12);
  
  --color-vtr-blue: #00A4E4;
  --color-vtr-orange: #FF7A00;

  /* Typography */
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  
  /* Radius */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 15px;
  --radius-xl: 20px;
  --radius-xxl: 30px;
  --radius-pill: 100px;

  /* Spacing */
  --space-card-padding: 24px;
  --space-section-mobile: 48px;
  --space-section-desktop: 96px;
}

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

html, body {
  width: 100%;
  height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  background-color: var(--color-canvas);
  color: var(--color-ink);
  font-feature-settings: 'cv01', 'cv11', 'ss03';
  line-height: 1.5;
  letter-spacing: -0.15px;
}

/* Selection */
::selection {
  background-color: var(--color-brand-magenta);
  color: #fff;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--color-canvas);
}
::-webkit-scrollbar-thumb {
  background: var(--color-surface-2);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: #333;
}

/* Typography Base */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-ink);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -1px;
}
p {
  color: var(--color-ink-muted);
}
a {
  color: var(--color-accent-blue);
  text-decoration: none;
  transition: opacity 0.2s;
}
a:hover {
  opacity: 0.8;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes glow-pulse {
  0% {
    opacity: 0.5;
    transform: scale(0.95);
  }
  100% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dot-pulse {
  0%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 100%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  to {
    opacity: 0;
    transform: translate(-50%, 100%);
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   LOGIN PAGE
   ========================================================================== */
body.login-body {
  background-color: var(--color-canvas-login);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

/* Noise overlay */
body.login-body::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
}

.login-screen {
  position: relative;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  box-sizing: border-box;
  z-index: 2;
  animation: slide-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Spotlight Glow behind login card */
.login-screen::before,
.login-screen::after {
  content: '';
  position: absolute;
  width: 350px;
  height: 350px;
  border-radius: 50%;
  filter: blur(90px);
  z-index: -1;
  pointer-events: none;
  animation: glow-pulse 4s ease-in-out infinite alternate;
}

.login-screen::before {
  top: 15%;
  left: calc(50% - 250px);
  background: radial-gradient(circle, rgba(230,0,126,0.2) 0%, transparent 70%);
}

.login-screen::after {
  bottom: 15%;
  right: calc(50% - 250px);
  background: radial-gradient(circle, rgba(106,76,245,0.2) 0%, transparent 70%);
  animation-delay: -2s;
}

.login-card {
  width: 100%;
  box-sizing: border-box;
  background: var(--color-surface-1);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-xl);
  padding: 44px 36px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}

.login-card-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-brand-magenta), var(--color-gradient-violet), var(--color-accent-blue), var(--color-brand-magenta));
  background-size: 300% 100%;
  animation: gradient-shift 3s linear infinite;
}

.login-logo-wrap {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo-img {
  width: 220px;
  max-width: 85%;
  height: auto;
  display: inline-block;
  filter: drop-shadow(0 0 16px rgba(0, 153, 255, 0.2));
}

.login-tagline {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-ink-muted);
  margin-top: 12px;
  font-weight: 500;
}

.login-card-title {
  font-size: 28px;
  margin-bottom: 8px;
  text-align: center;
  letter-spacing: -1px;
}

.login-card-sub {
  font-size: 14px;
  text-align: center;
  margin-bottom: 32px;
}

.login-field {
  margin-bottom: 20px;
}

.login-field label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-ink-muted);
  margin-bottom: 8px;
  font-weight: 500;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-wrap svg {
  position: absolute;
  left: 16px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--color-ink-muted);
  pointer-events: none;
}

.login-input-wrap input {
  width: 100%;
  background: var(--color-surface-2);
  border: 1px solid var(--color-hairline);
  color: var(--color-ink);
  font-family: inherit;
  font-size: 15px;
  padding: 14px 16px 14px 44px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.login-input-wrap input:focus {
  outline: none;
  border-color: var(--color-accent-blue);
  box-shadow: 0 0 0 3px rgba(0, 153, 255, 0.15);
}

.login-input-wrap input::placeholder {
  color: #666;
}

.login-toggle {
  position: absolute;
  right: 16px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.login-toggle:hover {
  opacity: 1;
}

.login-toggle svg {
  position: static;
  left: auto;
  pointer-events: auto;
}

.login-error {
  background: var(--color-error-bg);
  color: var(--color-error);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 20px;
  border: 1px solid rgba(239, 68, 68, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fade-in 0.3s;
}
.login-error.hidden {
  display: none;
}

.btn-login {
  width: 100%;
  background: #ffffff;
  color: #000000;
  border: none;
  border-radius: var(--radius-pill);
  padding: 16px 24px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  margin-top: 12px;
}

.btn-login:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(255,255,255,0.1);
}

.btn-login:active {
  transform: scale(0.98);
}

.btn-login.loading {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-login-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0,0,0,0.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn-login.loading .btn-login-spinner {
  display: block;
}

.btn-login.loading .btn-login-label,
.btn-login.loading .btn-login-arrow {
  display: none;
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 12px;
}

/* ==========================================================================
   APP SHELL
   ========================================================================== */
#app {
  width: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--color-canvas);
  position: relative;
  overflow: hidden;
}

.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.screen.active {
  display: flex;
  animation: fade-in 0.3s ease forwards;
}

/* Header / Brandbar */
.brandbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--color-surface-1);
  border-bottom: 1px solid var(--color-hairline);
  flex-shrink: 0;
  position: relative;
}

.brandbar-logo {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 32px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(0, 153, 255, 0.25));
}

.btn-logout {
  background: transparent;
  border: 1px solid var(--color-hairline);
  color: var(--color-ink-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.btn-logout:hover {
  background: var(--color-error-bg);
  color: var(--color-error);
  border-color: rgba(239, 68, 68, 0.4);
}

/* Main Area */
#main {
  flex: 1;
  overflow-y: auto;
  position: relative;
}

.inner {
  padding: 24px;
}

/* Secondary Header (Topbar) */
.topbar {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  background: var(--color-surface-1);
  border-bottom: 1px solid var(--color-hairline);
  flex-shrink: 0;
  gap: 16px;
}

.topbar .btn-icon {
  background: none;
  border: none;
  color: var(--color-ink);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.topbar .btn-icon:hover {
  background: var(--color-surface-2);
}

.topbar .title {
  font-size: 16px;
  font-weight: 600;
}

/* ==========================================================================
   CARDS & FORMS
   ========================================================================== */
.card {
  background: var(--color-surface-1);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-xl);
  padding: var(--space-card-padding);
  position: relative;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.card::before {
  content: '';
  position: absolute;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(0, 153, 255, 0.1) 0%, transparent 70%);
  top: -80px;
  right: -80px;
  filter: blur(60px);
  z-index: -1;
  border-radius: 50%;
}

.card-title {
  font-size: 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-title svg {
  color: var(--color-brand-magenta);
}

.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-ink-muted);
  margin-bottom: 8px;
}

.field input,
.field select {
  width: 100%;
  background: var(--color-surface-2);
  border: 1px solid var(--color-hairline);
  color: var(--color-ink);
  font-family: inherit;
  font-size: 15px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  appearance: none;
}

.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--color-accent-blue);
  box-shadow: 0 0 0 3px rgba(0, 153, 255, 0.15);
}

.field input::placeholder {
  color: #555;
}

.muted {
  font-size: 12px;
  color: var(--color-ink-muted);
  margin-top: 8px;
  display: block;
}

.rut-input-wrap {
  display: flex;
  gap: 12px;
}

.rut-input-wrap input {
  flex: 1;
}

/* Autocomplete Dropdown */
.autocomplete-field {
  position: relative;
}

.autocomplete-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #18181b !important;
  border: 1px solid #27272a !important;
  border-radius: var(--radius-md) !important;
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.7), 0 0 1px 1px rgba(255, 255, 255, 0.05) !important;
  max-height: 220px;
  overflow-y: auto;
  z-index: 100;
  padding: 4px;
  display: none;
}

.autocomplete-list:not(:empty):not(.hidden) {
  display: flex !important;
  flex-direction: column !important;
}

.autocomplete-list button.autocomplete-item,
.autocomplete-list .ac-item,
.autocomplete-list .autocomplete-item {
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  box-sizing: border-box !important;
  background: transparent !important;
  border: none !important;
  border-radius: 6px !important;
  color: #e4e4e7 !important;
  font-family: inherit !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
  padding: 10px 14px !important;
  text-align: left !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  margin-bottom: 2px !important;
  outline: none !important;
}

.autocomplete-list button.autocomplete-item:last-child,
.autocomplete-list .ac-item:last-child,
.autocomplete-list .autocomplete-item:last-child {
  margin-bottom: 0 !important;
}

.autocomplete-list button.autocomplete-item:hover,
.autocomplete-list button.autocomplete-item:focus,
.autocomplete-list .ac-item:hover,
.autocomplete-list .autocomplete-item:hover {
  background: rgba(230, 0, 126, 0.15) !important;
  color: #ffffff !important;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn-primary {
  width: 100%;
  background: #ffffff;
  color: #000000;
  border: none;
  border-radius: var(--radius-pill);
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 15px rgba(255,255,255,0.1);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary svg {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   LOADING / SPINNER
   ========================================================================== */
.loading-wrap {
  position: absolute;
  inset: 0;
  background: rgba(9, 9, 9, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  border-radius: inherit;
}

.loading-wrap.hidden {
  display: none;
}

.spinner-vtr {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.spinner-vtr span {
  width: 12px;
  height: 12px;
  background-color: var(--color-brand-magenta);
  border-radius: 50%;
  animation: dot-pulse 1.2s infinite ease-in-out both;
}

.spinner-vtr span:nth-child(1) { animation-delay: -0.32s; }
.spinner-vtr span:nth-child(2) { animation-delay: -0.16s; }

#loading-msg {
  font-size: 14px;
  color: var(--color-ink-muted);
}

/* ==========================================================================
   RESULTS PAGE — app.js dynamic components
   ========================================================================== */

/* Legacy colour aliases used by app.js inline styles */
:root {
  --green: #22c55e;
  --gray: #666;
  --red: #ef4444;
  --warn-y: #f59e0b;
}

/* Constrain ALL inline SVGs in result screens so icons don't blow up */
.result-screen svg,
.result-body svg,
.client-header svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  vertical-align: middle;
}

.result-screen {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Client header (rendered by renderVtrResult / renderRutResult) ── */
.client-header {
  background: var(--color-surface-1);
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-hairline);
}

.client-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 2px;
}

.client-sub {
  font-size: 13px;
  color: var(--color-ink-muted);
}

.client-cat {
  font-size: 11px;
  color: var(--color-ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* ── Result body ── */
.result-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Semáforo pill (FTTH + coloured service icons) ── */
.pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface-1);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-pill);
  padding: 12px 20px;
  font-size: 14px;
}

.pill.semaforo {
  font-weight: 600;
}

.pill .tipo-red {
  font-weight: 600;
}

.pill .icons {
  display: flex;
  gap: 10px;
}

.pill .icons span svg {
  width: 22px;
  height: 22px;
}

.pill-label {
  font-weight: 500;
}

.pill-value {
  font-weight: 400;
  text-align: right;
}

/* ── Restriction pill (bloqueado / 1Play) ── */
.pill.pill-restriction {
  gap: 10px;
  justify-content: flex-start;
}

.pill-x-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.pill-x-icon svg {
  display: block;
}

.pill-restriction-text {
  font-weight: 500;
  font-size: 14px;
}

/* ── Warn box (servicios activos con titular) ── */
.warn-box {
  background: var(--color-surface-1);
  border: 1px solid var(--color-hairline);
  border-left: 3px solid var(--warn-y);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.warn-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}

.warn-title svg {
  width: 18px;
  height: 18px;
}

.warn-sub {
  font-size: 13px;
  color: var(--color-ink-muted);
  padding-left: 26px;
}

/* ── Detail card (Detalle RUT / Dirección / Deudas anteriores) ── */
.detail-card {
  background: var(--color-surface-1);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.detail-head {
  background: var(--color-surface-2);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  border-bottom: 1px solid var(--color-hairline);
}

.detail-body {
  padding: 14px 16px;
}

/* Status rows inside detail cards */
.srow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 14px;
}

.srow.muted {
  opacity: 0.5;
}

.srow svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.srow-text {
  flex: 1;
}

.srow-logo {
  width: 24px;
  height: 16px;
  object-fit: contain;
}

/* Deuda rows */
.deuda-summary {
  font-size: 13px;
  color: var(--color-ink-muted);
  margin: 8px 0 4px;
  text-align: center;
}

.deuda-divider {
  height: 1px;
  background: var(--color-hairline);
  margin: 6px 0;
}

.deuda-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
}

.deuda-row .amount {
  font-weight: 500;
  text-align: right;
}

.total-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-success-bg);
  color: var(--color-success);
  padding: 10px 16px;
  margin: 8px -16px -14px;
  font-weight: 700;
  font-size: 15px;
}

.deuda-sep {
  height: 1px;
  background: var(--color-hairline-soft);
  margin: 4px 0;
}

.deuda-anteriores-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
}

.deuda-anteriores-row .amount {
  font-weight: 500;
}

/* ── RUT verdict banner (aprobado / rechazado) ── */
.rut-verdict {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  font-size: 15px;
  font-weight: 600;
}

.rut-verdict.approved {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.rut-verdict.blocked {
  background: var(--color-error-bg);
  color: var(--color-error);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.rut-verdict.restricted {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.rut-verdict svg {
  width: 24px;
  height: 24px;
}

/* ── Error / Not-found cards ── */
.error-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--color-error-bg);
  color: var(--color-error);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 14px;
}

.not-found-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--color-surface-1);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 14px;
  color: var(--color-ink-muted);
}

.not-found-card svg {
  width: 24px;
  height: 24px;
  color: var(--color-ink-muted);
}

/* ── VTR mark dots ── */
.vtr-mark {
  display: inline-flex;
  gap: 3px;
}

.vtr-mark i {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.vtr-mark i:nth-child(1) { background: var(--color-vtr-blue); }
.vtr-mark i:nth-child(2) { background: var(--color-vtr-orange); }
.vtr-mark i:nth-child(3) { background: var(--color-brand-magenta); }

/* Result Cards */
.result-card {
  background: var(--color-surface-1);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.result-card h3 {
  font-size: 16px;
  margin-bottom: 16px;
  color: var(--color-ink);
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-hairline-soft);
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--color-hairline-soft);
}

.result-row:last-child {
  border-bottom: none;
}

.result-row .label {
  font-size: 13px;
  color: var(--color-ink-muted);
}

.result-row .value {
  font-size: 14px;
  font-weight: 500;
  text-align: right;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-icon {
  width: 12px;
  height: 12px;
}

.badge-green {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.badge-red {
  background: var(--color-error-bg);
  color: var(--color-error);
}

.badge-yellow {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.badge-gray {
  background: rgba(255,255,255,0.06);
  color: #999;
}

/* Ficha (Factibility Header) */
.ficha-header {
  margin-bottom: 24px;
}

.ficha-title {
  font-size: 22px;
  margin-bottom: 4px;
}

.ficha-dir {
  font-size: 14px;
  color: var(--color-ink-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Services Grid */
.servicios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.servicio-chip {
  background: var(--color-surface-2);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.2s;
}

.servicio-chip:hover {
  transform: translateY(-2px);
}

.servicio-chip.si {
  border-left: 3px solid var(--color-success);
}

.servicio-chip.no {
  border-left: 3px solid #666;
  opacity: 0.5;
}

.chip-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
}

.servicio-chip.si .chip-icon svg {
  color: var(--color-ink);
}

.chip-label {
  font-size: 14px;
  font-weight: 500;
}

/* Deuda */
.deuda-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
}

.deuda-total {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-error);
}

/* Address Picker Cards & Screen */
.pick-intro {
  font-size: 14px;
  color: var(--color-ink-muted);
  line-height: 1.5;
  margin-bottom: 16px;
  background: var(--color-surface-1);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-hairline);
}

.pick-search-wrap {
  position: relative;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
}

#pick-search {
  width: 100%;
  background: var(--color-surface-1);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  padding-right: 100px;
  color: #ffffff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

#pick-search:focus {
  border-color: var(--color-accent-blue);
  box-shadow: 0 0 0 3px rgba(0, 153, 255, 0.2);
}

.pick-search-count {
  position: absolute;
  right: 16px;
  font-size: 12px;
  color: var(--color-ink-muted);
  pointer-events: none;
  font-weight: 600;
  background: var(--color-surface-2);
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-hairline);
}

.pick-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-ink-muted);
  font-size: 14px;
  background: var(--color-surface-1);
  border-radius: var(--radius-md);
  border: 1px dashed var(--color-hairline);
}

.pick-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pick-item,
button.pick-item,
.pick-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  width: 100% !important;
  box-sizing: border-box !important;
  background: var(--color-surface-1) !important;
  border: 1px solid var(--color-hairline) !important;
  border-left: 4px solid var(--color-brand-magenta) !important;
  border-radius: var(--radius-md) !important;
  padding: 16px 20px !important;
  text-align: left !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  outline: none !important;
  color: var(--color-ink) !important;
  font-family: inherit !important;
  margin-bottom: 0 !important;
}

.pick-item:hover,
button.pick-item:hover,
.pick-item:focus,
button.pick-item:focus,
.pick-card:hover {
  background: var(--color-surface-2) !important;
  border-color: var(--color-accent-blue) !important;
  border-left-color: var(--color-accent-blue) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.pick-label {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 4px;
  display: block;
}

.pick-meta {
  font-size: 12px;
  color: var(--color-ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
}

.rut-result {
  margin-top: 24px;
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-surface-1);
  color: var(--color-ink);
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  border: 1px solid var(--color-hairline);
  z-index: 1000;
  display: none;
}

#toast.show {
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toast-in 0.3s forwards;
}

#toast.hide {
  animation: toast-out 0.3s forwards;
}

/* ==========================================================================
   RESPONSIVE LAYOUT (MOBILE TO DESKTOP)
   ========================================================================== */

/* Mobile First: handled by default styles */

/* Tablet (768px+) */
@media (min-width: 768px) {
  .inner {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px 24px;
  }
  
  .result-body {
    max-width: 700px;
    margin: 0 auto;
  }
}

/* Desktop Windowed Mode (>1024px) */
@media (min-width: 1024px) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #050505; /* Outer desktop bg */
  }
  
  /* Background subtle grid/texture for desktop container */
  body::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
      linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: 0;
    pointer-events: none;
  }

  #app {
    max-width: 900px;
    max-height: calc(100dvh - 48px);
    border-radius: 24px;
    border: 1px solid var(--color-hairline);
    box-shadow: 0 40px 100px -20px rgba(0,0,0,0.8), 0 0 40px rgba(106,76,245,0.1);
    z-index: 1;
  }
  
  .inner {
    max-width: 520px; /* Tighter for forms */
  }
  
  /* Make results a bit wider than forms */
  .result-screen .inner {
    max-width: 800px;
  }
  
  .servicios-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .login-card {
    padding: 48px 40px;
  }
}
