/* ==========================================================================
   Registro de Contactos - X brands × NAHREP
   Minimalist Monochrome Executive Design (No SaaS/AI look, no harsh shadows)
   ========================================================================== */

:root {
  --bg: #0C0C0E;
  --surface: #151518;
  --surface-hover: #1C1C22;
  --text-main: #FFFFFF;
  --text-muted: #8E8E93;
  --border: rgba(255, 255, 255, 0.12);
  --border-focus: #FFFFFF;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

@font-face {
  font-family: 'Nizzoli';
  src: url('../assets/fonts/NIZZOLI/Fontspring-DEMO-nizzoli-bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

body {
  background-color: var(--bg);
  color: var(--text-main);
  font-family: var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}

.registro-container {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: auto;
}

/* Header Co-branding (Idéntico a card.html y ejecutivos) */
.brand-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding-bottom: 2px;
}

.brand-xbrands-img {
  height: 24px;
  width: auto;
  display: block;
  object-fit: contain;
}

.brand-divider {
  width: 1px;
  height: 26px;
  background-color: var(--border);
}

.brand-nahrep-img {
  height: 28px;
  width: auto;
  display: block;
  opacity: 0.95;
  object-fit: contain;
}

.page-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
  color: #FFFFFF;
  margin: 0;
}

/* Nav Segment Tabs */
.view-tabs {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px;
  gap: 3px;
  width: 100%;
}

.tab-btn {
  flex: 1;
  padding: 7px 12px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.80rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn.active {
  background: #FFFFFF;
  color: #09090B;
}

/* Form Container - Vertical por defecto (Pantallas grandes 2K y Móviles) */
.form-card,
#viewForm {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px 22px;
  width: 100%;
  box-sizing: border-box;
}

#leadForm,
.form-card form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  width: 100%;
}

.form-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.1;
}

.form-input, .form-select, .form-textarea {
  background: #09090B;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 11px 13px;
  color: #FFFFFF;
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: rgba(255, 255, 255, 0.45);
  background-color: #0F0F12;
}

.form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238E8E93' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-select option {
  background-color: #151518;
  color: #FFFFFF;
}

.form-textarea {
  resize: vertical;
  min-height: 60px;
}

.btn-submit {
  background: #FFFFFF;
  color: #09090B;
  border: 1px solid #FFFFFF;
  border-radius: 6px;
  padding: 12px 18px;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: all 0.2s ease;
  margin-top: 4px;
  width: 100%;
}

.btn-submit:hover {
  background: #E4E4E7;
  border-color: #E4E4E7;
}

.btn-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Pantallas Pequeñas / Laptops (ej. 1215 × 787): 2 Columnas Sin Scroll */
@media screen and (min-width: 601px) and (max-height: 900px),
       screen and (min-width: 601px) and (max-width: 1440px) and (max-height: 960px) {
  body {
    padding: 12px 16px;
  }

  .registro-container {
    max-width: 680px;
    gap: 10px;
  }

  .brand-header {
    padding-bottom: 0;
  }

  .page-title {
    font-size: 0.98rem;
  }

  .view-tabs {
    padding: 2px;
  }

  .tab-btn {
    padding: 6px 10px;
    font-size: 0.78rem;
  }

  .form-card,
  #viewForm {
    padding: 16px 20px;
  }

  #leadForm,
  .form-card form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px 14px;
    width: 100%;
    box-sizing: border-box;
  }

  .form-group.full-width,
  .form-group-full,
  .btn-submit {
    grid-column: 1 / -1;
  }

  .form-group {
    gap: 4px;
  }

  .form-input, .form-select, .form-textarea {
    padding: 8px 11px;
    font-size: 0.85rem;
    width: 100%;
    box-sizing: border-box;
  }

  .form-textarea {
    resize: none;
    height: 46px;
    min-height: 46px;
  }

  .btn-submit {
    padding: 10px 16px;
    font-size: 0.82rem;
    margin-top: 2px;
  }
}

/* Records List View */
.records-card,
#viewList {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
}

.records-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
}

.records-count {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.records-actions {
  display: flex;
  gap: 8px;
}

.btn-secondary-action {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 12px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-secondary-action:hover {
  background: var(--surface-hover);
  border-color: #FFFFFF;
}

.records-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 520px;
  overflow-y: auto;
  text-align: left;
}

.record-item {
  background: #0C0C0E;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.record-header-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.record-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #FFFFFF;
}

.record-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.record-meta {
  font-size: 0.78rem;
  color: #D1D5DB;
}

.record-advisor-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.record-notes {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-style: italic;
}

.empty-state {
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
}

/* Toast Message */
.toast-msg {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(40px);
  background: #FFFFFF;
  color: #000000;
  padding: 10px 20px;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 100;
  white-space: nowrap;
}

.toast-msg.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Footer Link */
.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.74rem;
  margin-top: 8px;
}

.footer-link:hover {
  color: #FFFFFF;
}

@media (max-width: 480px) {
  body {
    padding: 16px 12px;
  }

  .form-card,
  #viewForm {
    padding: 18px 16px;
  }

  .records-card {
    padding: 18px 16px;
  }
}

/* ==========================================================================
   Print / PDF Styles
   ========================================================================== */
@media print {
  body {
    background-color: #FFFFFF !important;
    color: #000000 !important;
    padding: 0 !important;
  }

  .view-tabs, .btn-submit, .records-actions, .footer-link, .toast-msg, .form-card {
    display: none !important;
  }

  .registro-container {
    max-width: 100% !important;
  }

  .records-card {
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
  }

  .record-item {
    background: #FFFFFF !important;
    border: 1px solid #CCCCCC !important;
    color: #000000 !important;
    page-break-inside: avoid;
    margin-bottom: 8px;
  }

  .record-name {
    color: #000000 !important;
  }

  .record-meta, .record-advisor-tag, .record-date, .record-notes {
    color: #333333 !important;
  }
}
