/**
 * Estilos CSS3 Nativo - Portal Móvil de Autoservicio en Sala de Espera
 * IPS AYG Servicios de Salud SAS
 */

:root {
  --ayg-green-dark: #1E5622;
  --ayg-green-primary: #3D8C3C;
  --ayg-green-bright: #56AF55;
  --ayg-green-soft: #ECFDF3;
  --ayg-teal: #00897B;
  --bg-page: #F3F7F5;
  --bg-card: #FFFFFF;
  --text-main: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --border-light: #E2E8F0;
  --warning-bg: #FFFBEB;
  --warning-border: #FDE68A;
  --warning-text: #92400E;
  --danger-bg: #FEF2F2;
  --danger-text: #B91C1C;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 25px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 40px rgba(30, 86, 34, 0.14);
  --radius-md: 14px;
  --radius-lg: 20px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hidden {
  display: none !important;
}

/* ==========================================================
   CABECERA Y BANNER DE SEDE (QR)
   ========================================================== */
.app-header {
  background: linear-gradient(135deg, var(--ayg-green-dark) 0%, var(--ayg-green-primary) 60%, var(--ayg-teal) 100%);
  color: #FFFFFF;
  padding: 20px 16px 22px;
  box-shadow: 0 4px 20px rgba(30, 86, 34, 0.2);
}

.header-inner {
  max-width: 640px;
  margin: 0 auto;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.brand-titles {
  flex: 1;
}

.brand-eyebrow {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #BBF7D0;
  text-transform: uppercase;
}

.brand-titles h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}

.qr-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: background 0.2s ease, transform 0.15s ease;
}

.qr-link-btn:hover {
  background: rgba(255, 255, 255, 0.26);
  transform: translateY(-1px);
}

.sede-banner {
  background: rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.sede-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
}

.sede-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4ADE80;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.25);
  flex-shrink: 0;
}

.sede-dot.upcoming {
  background: #FBBF24;
  box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.25);
}

.sede-label {
  color: #E2E8F0;
  font-size: 0.78rem;
  display: block;
}

.sede-switcher select {
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-main);
  border: none;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

/* ==========================================================
   CONTENEDOR PRINCIPAL
   ========================================================== */
.main-wrapper {
  max-width: 640px;
  width: 100%;
  margin: -12px auto 32px;
  padding: 0 16px;
  flex: 1;
}

.ttl-notice {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--warning-text);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.ttl-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

/* ==========================================================
   TARJETA DE BÚSQUEDA
   ========================================================== */
.search-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  margin-bottom: 20px;
}

.search-card h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  color: var(--text-main);
  margin-bottom: 4px;
}

.search-subtitle {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-bottom: 14px;
}

.channels-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.channel-pill {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  background: #F1F5F9;
  color: var(--text-secondary);
  border: 1px solid #E2E8F0;
  transition: all 0.2s ease;
}

.channel-pill.active {
  background: var(--ayg-green-soft);
  color: var(--ayg-green-dark);
  border-color: var(--ayg-green-bright);
  transform: scale(1.03);
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.input-icon {
  position: absolute;
  left: 14px;
  font-size: 1.2rem;
  pointer-events: none;
}

.input-wrapper input {
  width: 100%;
  padding: 15px 42px 15px 46px;
  font-size: 1rem;
  font-weight: 500;
  border: 2px solid #CBD5E1;
  border-radius: var(--radius-md);
  background: #F8FAFC;
  color: var(--text-main);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--ayg-green-primary);
  background: #FFFFFF;
  box-shadow: 0 0 0 4px rgba(61, 140, 60, 0.14);
}

.btn-clear {
  position: absolute;
  right: 12px;
  background: #E2E8F0;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text-secondary);
}

.btn-primary-large {
  width: 100%;
  padding: 15px 20px;
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #FFFFFF;
  background: linear-gradient(135deg, var(--ayg-green-primary) 0%, var(--ayg-teal) 100%);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(61, 140, 60, 0.28);
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary-large:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(61, 140, 60, 0.35);
}

.btn-primary-large:active {
  transform: translateY(0);
}

.btn-primary-large:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ==========================================================
   BARRA DEMO RÁPIDA
   ========================================================== */
.demo-helper {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed #CBD5E1;
}

.demo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 6px;
}

.btn-link-small {
  background: none;
  border: none;
  color: var(--ayg-teal);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.demo-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.demo-chip {
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.demo-chip:hover {
  background: var(--ayg-green-soft);
  border-color: var(--ayg-green-primary);
  color: var(--ayg-green-dark);
}

/* ==========================================================
   RESULTADOS Y TARJETAS DE DOCUMENTOS
   ========================================================== */
.results-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.patient-summary-banner {
  background: var(--ayg-green-soft);
  border: 1px solid #A7F3D0;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.patient-summary-banner h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  color: var(--ayg-green-dark);
}

.patient-summary-banner p {
  font-size: 0.82rem;
  color: #065F46;
}

.badge-count {
  background: var(--ayg-green-primary);
  color: #FFFFFF;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
}

.doc-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 18px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.doc-card:hover {
  box-shadow: var(--shadow-md);
}

.doc-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.doc-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.doc-meta {
  flex: 1;
}

.doc-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  word-break: break-word;
}

.doc-origin {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.ttl-timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  background: #FEF3C7;
  color: #92400E;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.btn-print-single {
  width: 100%;
  padding: 12px 16px;
  background: #0F172A;
  color: #FFFFFF;
  border: none;
  border-radius: 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s ease;
}

.btn-print-single:hover {
  background: #1E293B;
}

.empty-state-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.empty-state-icon {
  font-size: 2.6rem;
  margin-bottom: 10px;
}

.empty-state-card h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.empty-state-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  max-width: 440px;
  margin: 0 auto;
}

.printed-history-box {
  margin-top: 16px;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 12px;
  padding: 14px;
  text-align: left;
}

.printed-history-box h4 {
  font-size: 0.85rem;
  color: var(--ayg-green-dark);
  margin-bottom: 6px;
}

.printed-item-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #166534;
  padding: 4px 0;
  border-bottom: 1px dashed #BBF7D0;
}

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

/* ==========================================================
   MODAL DE IMPRESIÓN EN SALA
   ========================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal-card {
  background: #FFFFFF;
  max-width: 420px;
  width: 100%;
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.printer-animation {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--ayg-green-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
}

.modal-card h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  margin-bottom: 6px;
}

.modal-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.progress-bar-track {
  width: 100%;
  height: 10px;
  background: #E2E8F0;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-bar-fill {
  height: 100%;
  width: 15%;
  background: linear-gradient(90deg, var(--ayg-green-primary), var(--ayg-teal));
  border-radius: 999px;
  transition: width 0.4s ease;
}

.modal-details {
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: #F8FAFC;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 16px;
  text-align: left;
}

/* ==========================================================
   FOOTER
   ========================================================== */
.app-footer {
  text-align: center;
  padding: 20px 16px 28px;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
  background: #FFFFFF;
}

.footer-note {
  margin-top: 4px;
  font-size: 0.74rem;
}
