/**
 * Brokers Core — Native Mobile Application Stylesheet v8.4.0 (Autonomous App)
 * Design System: 80% Crisp White Clean Aesthetic + Brand Accents
 */

:root {
  --color-brand-dark: #081430;
  --color-brand-navy: #051026;
  --color-brand-cyan: #00d2ff;
  --color-brand-orange: #fe6500;
  --color-brand-orange-hover: #e05800;
  --color-bg-app: #f8fafc;
  --color-bg-card: #ffffff;
  --color-bg-subtle: #f1f5f9;
  --color-border: #e2e8f0;
  --color-text-main: #0f172a;
  --color-text-muted: #64748b;
  --color-text-light: #94a3b8;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #0284c7;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Manrope', 'Inter', sans-serif;
  --radius-sm: 0.6rem;
  --radius-md: 0.9rem;
  --radius-lg: 1.25rem;
  --radius-full: 9999px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; height: 100%; overflow-x: hidden; font-family: var(--font-sans); background-color: var(--color-bg-app) !important; color: var(--color-text-main) !important; }
body { display: flex; flex-direction: column; min-height: 100vh; padding-bottom: 85px; }

/* Logo Defensive Sizing */
img { max-width: 100%; height: auto; }
.login-logo {
  max-width: 270px !important;
  max-height: 95px !important;
  width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
  display: block !important;
  margin: 0 auto 0.75rem !important;
}
.brand-logo-img {
  max-width: 140px !important;
  max-height: 40px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
}
  object-fit: contain !important;
}

/* Header */
.native-header {
  position: sticky; top: 0; z-index: 500; background: #ffffff;
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
  padding: 0 1.2rem; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}
.native-header-brand { display: flex; align-items: center; gap: 0.65rem; text-decoration: none; }
.brand-fallback-badge {
  background: linear-gradient(135deg, var(--color-brand-dark) 0%, var(--color-brand-navy) 100%);
  color: #ffffff; padding: 0.4rem 0.75rem; border-radius: var(--radius-sm);
  font-family: var(--font-heading); font-weight: 800; font-size: 0.85rem;
  display: flex; align-items: center; gap: 0.4rem;
}
.header-user-badge {
  width: 40px; height: 40px; border-radius: 50%; background: var(--color-bg-subtle);
  border: 1.5px solid var(--color-border); display: flex; align-items: center; justify-content: center;
  color: var(--color-brand-dark); font-size: 0.95rem; cursor: pointer;
}

/* Login View - Fits 100% to device screen height with SaaS Dark Grid theme matching brokerscorecrm.com/login */
.login-viewport {
  height: 100vh;
  height: 100dvh;
  width: 100%;
  background-color: #030712 !important;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) !important;
  background-size: 60px 60px, 60px 60px !important;
  background-position: center center !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow-y: auto;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.login-viewport .neon-glow-bg {
  position: fixed;
  inset: -50%;
  background:
    radial-gradient(circle at 30% 20%, rgba(0, 210, 255, 0.16) 0%, transparent 38%),
    radial-gradient(circle at 70% 80%, rgba(254, 101, 0, 0.16) 0%, transparent 38%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.02) 0%, transparent 50%);
  filter: blur(80px);
  z-index: 0;
  pointer-events: none;
  animation: pulse-glow-mobile 10s infinite alternate ease-in-out;
}
@keyframes pulse-glow-mobile {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.05); opacity: 1; }
}
.login-viewport.hidden { opacity: 0; pointer-events: none; transform: translateY(-20px); }

/* Clean Crisp White Inner Card */
.login-card {
  max-width: 410px;
  width: 100%;
  margin: auto;
  background: #ffffff !important;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(0, 210, 255, 0.18);
  padding: 1.65rem 1.35rem;
  text-align: center;
  max-height: 98vh;
  max-height: 98dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 10;
}
.login-logo-container { margin-bottom: 0.85rem; display: flex; justify-content: center; }
.login-title { font-family: var(--font-heading); font-size: 1.25rem; font-weight: 800; color: var(--color-brand-dark); margin-bottom: 0.2rem; }
.login-subtitle { font-size: 0.78rem; color: var(--color-text-muted); margin-bottom: 1.1rem; }

.login-inline-error {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #e11d48;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.85rem;
  text-align: left;
}
.login-inline-error i {
  font-size: 1.15rem;
  color: #f43f5e;
  flex-shrink: 0;
}

.form-group { margin-bottom: 0.85rem; text-align: left; }
.form-label { font-size: 0.75rem; font-weight: 700; color: var(--color-brand-dark); display: block; margin-bottom: 0.35rem; text-transform: uppercase; letter-spacing: 0.03em; }
.input-field-wrapper { position: relative; display: flex; align-items: center; }
.input-field-icon { position: absolute; left: 14px; color: var(--color-text-muted); font-size: 0.9rem; }
.native-input {
  width: 100%; padding: 0.8rem 1rem 0.8rem 2.5rem; border-radius: var(--radius-md);
  border: 1.5px solid var(--color-border); background: var(--color-bg-app);
  color: var(--color-text-main); font-size: 0.9rem; font-weight: 600; outline: none;
}
.native-input:focus { border-color: var(--color-brand-dark); background: #ffffff; box-shadow: 0 0 0 4px rgba(8, 20, 48, 0.08); }
.toggle-pwd-btn { position: absolute; right: 12px; background: transparent; border: none; color: var(--color-text-muted); cursor: pointer; font-size: 0.9rem; }

.btn-brand-primary {
  width: 100%; padding: 0.9rem 1.25rem; border-radius: var(--radius-md);
  background: var(--color-brand-orange); color: #ffffff; border: none;
  font-weight: 800; font-size: 0.9rem; cursor: pointer;
  box-shadow: 0 6px 18px rgba(254, 101, 0, 0.25); display: inline-flex;
  align-items: center; justify-content: center; gap: 0.5rem;
}
.btn-brand-primary:active { transform: scale(0.98); }
.btn-brand-secondary {
  width: 100%; padding: 0.8rem 1.25rem; border-radius: var(--radius-md);
  background: var(--color-bg-subtle); color: var(--color-brand-dark);
  border: 1.5px solid var(--color-border); font-weight: 700; font-size: 0.85rem;
  cursor: pointer; margin-top: 0.65rem; display: inline-flex;
  align-items: center; justify-content: center; gap: 0.5rem; text-decoration: none;
}

/* Main Body & Section Cards */
.main-mobile-body { max-width: 600px; margin: 0 auto; width: 100%; padding: 1.25rem; }
.hero-welcome-card {
  background: #ffffff; border-radius: var(--radius-lg); border: 1px solid var(--color-border);
  padding: 1.25rem 1.5rem; margin-bottom: 1.25rem; box-shadow: 0 4px 12px rgba(0,0,0,0.03);
  display: flex; justify-content: space-between; align-items: center;
}
.welcome-title { font-family: var(--font-heading); font-size: 1.15rem; font-weight: 800; color: var(--color-brand-dark); }
.welcome-subtitle { font-size: 0.78rem; color: var(--color-text-muted); margin-top: 0.15rem; }

.mobile-native-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: 1.25rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
  margin-bottom: 1.25rem;
}

.form-section-header {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--color-brand-dark);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-bottom: 0.4rem;
  margin: 1.2rem 0 0.85rem;
  border-bottom: 1.5px solid var(--color-bg-subtle);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.section-header-title {
  font-family: var(--font-heading); font-size: 0.95rem; font-weight: 800;
  color: var(--color-brand-dark); margin-bottom: 0.85rem;
  display: flex; align-items: center; justify-content: space-between;
}

/* Bottom Navigation Bar (5 Items) */
.native-bottom-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 600; height: 72px;
  background: #ffffff; border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.04); display: flex;
  align-items: center; justify-content: space-around; padding: 0 0.25rem;
}
.tab-nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex: 1; height: 100%; color: var(--color-text-muted); text-decoration: none;
  font-size: 0.65rem; font-weight: 700; position: relative; background: transparent; border: none; cursor: pointer;
}
.tab-nav-item i { font-size: 1.15rem; margin-bottom: 3px; }
.tab-nav-item.active { color: var(--color-brand-orange); }
.tab-active-indicator { position: absolute; top: 0; width: 24px; height: 3px; background: var(--color-brand-orange); border-radius: 0 0 4px 4px; }

/* Modals */
.native-modal {
  position: fixed; inset: 0; z-index: 1200; background: rgba(8, 20, 48, 0.4);
  backdrop-filter: blur(6px); display: flex; align-items: flex-end;
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.native-modal.active { opacity: 1; pointer-events: auto; }
.modal-sheet-content {
  width: 100%; max-width: 600px; margin: 0 auto; background: #ffffff;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: 1.5rem;
  max-height: 85vh; overflow-y: auto; transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.native-modal.active .modal-sheet-content { transform: translateY(0); }
.sheet-handle { width: 36px; height: 4px; border-radius: 2px; background: var(--color-border); margin: 0 auto 1.2rem; }

/* Filter Chips */
.filter-chip {
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-full);
  background: var(--color-bg-subtle);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.filter-chip.active, .filter-chip:hover {
  background: var(--color-brand-dark);
  color: #ffffff;
  border-color: var(--color-brand-dark);
}

/* ══ MULTI-STEP WIZARD STYLES (PASO A PASO TOUCH) ══ */
.wizard-progress-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  margin-bottom: 1.5rem;
  padding: 0 0.5rem;
}
.wizard-progress-bar::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 1.5rem;
  right: 1.5rem;
  height: 3px;
  background: var(--color-border);
  transform: translateY(-50%);
  z-index: 1;
}
.wizard-step-item {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--color-border);
  color: var(--color-text-muted);
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
}
.wizard-step-item.active {
  border-color: var(--color-brand-orange);
  background: var(--color-brand-orange);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(254, 101, 0, 0.3);
}
.wizard-step-item.completed {
  border-color: var(--color-brand-dark);
  background: var(--color-brand-dark);
  color: var(--color-brand-cyan);
}

/* ══ DRAG & DROP ZONE STYLES ══ */
.dropzone-area {
  border: 2px dashed var(--color-brand-cyan);
  background: #f0fdfa;
  border-radius: var(--radius-md);
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.dropzone-area:hover, .dropzone-area.dragover {
  border-color: var(--color-brand-orange);
  background: #fff8f3;
  transform: scale(1.01);
}
.dropzone-icon {
  font-size: 2.2rem;
  color: var(--color-brand-orange);
  margin-bottom: 0.5rem;
  display: block;
}
.dropzone-title {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--color-brand-dark);
  margin-bottom: 0.2rem;
}
.dropzone-subtitle {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* Previews Grid */
.preview-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}
.preview-photo-tile {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--color-border);
  background: #f8fafc;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}
.preview-photo-tile.is-principal {
  border-color: var(--color-brand-orange) !important;
  box-shadow: 0 4px 12px rgba(254, 101, 0, 0.3) !important;
}
.preview-photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.btn-remove-tile {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.9);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.badge-principal-btn {
  position: absolute;
  bottom: 5px;
  left: 5px;
  right: 5px;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 0.65rem;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  z-index: 2;
  transition: all 0.2s ease;
}
.badge-principal-btn.active {
  background: var(--color-brand-orange) !important;
  border-color: var(--color-brand-orange) !important;
  color: #ffffff !important;
}

/* Touch Friendly Large Buttons */
.btn-touch-action {
  min-height: 48px;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
  font-weight: 800;
}


