/* ==========================================================================
   AIP PERÚ - ESTILO CLARO, MINIMALISTA Y RESPONSIVO (MOBILE-FIRST)
   ========================================================================== */

:root {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;

  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #e0f2fe;

  --alert-bg: #fffbeb;
  --alert-border: #fde68a;
  --alert-accent: #d97706;
  --alert-text: #92400e;

  --border-color: #e2e8f0;
  --border-focus: #bae6fd;

  --status-green: #16a34a;
  --status-green-bg: #dcfce7;

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.08);
  --shadow-btn: 0 4px 14px rgba(2, 132, 199, 0.25);
  --transition: all 0.2s ease-in-out;
}

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

html {
  font-family: var(--font-family);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Barra Superior Limpia */
.top-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1rem;
}

.header-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-badge {
  background: var(--primary);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.brand-info h2 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.brand-info span {
  font-size: 0.75rem;
  color: var(--text-light);
  display: block;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--status-green-bg);
  color: var(--status-green);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
}

.status-dot {
  width: 7px;
  height: 7px;
  background-color: var(--status-green);
  border-radius: 50%;
}

/* Contenido Central */
.main-content {
  max-width: 860px;
  width: 100%;
  margin: 1.5rem auto 3rem auto;
  padding: 0 1rem;
  flex: 1;
}

/* Alerta de Contingencia */
.alert-contingency {
  background: var(--alert-bg);
  border: 1px solid var(--alert-border);
  border-left: 5px solid var(--alert-accent);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.alert-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.alert-body h2 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--alert-accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.35rem;
}

.alert-body p {
  font-size: 1rem;
  color: var(--alert-text);
  line-height: 1.5;
}

.alert-body strong {
  font-weight: 700;
  color: #78350f;
}

/* Tarjeta Principal */
.main-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-md);
  text-align: center;
  margin-bottom: 1.5rem;
}

.main-card h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
  margin-bottom: 0.6rem;
  letter-spacing: -0.3px;
}

.main-card .subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto 1.75rem auto;
}

/* Botón de Enlace de Respaldo */
.action-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.btn-aip-access {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background: var(--primary);
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  padding: 1rem 2rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-btn);
  transition: var(--transition);
  width: 100%;
  max-width: 480px;
}

.btn-aip-access:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.35);
}

.btn-aip-access svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Copiar Enlace Directo */
.copy-url-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  width: 100%;
  max-width: 480px;
}

.copy-url-text {
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--primary-hover);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: all;
}

.btn-copy-link {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-copy-link:hover {
  background: #f8fafc;
  color: var(--text-main);
  border-color: #cbd5e1;
}

/* Tarjetas Informativas Rápidas */
.info-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
  text-align: left;
}

.info-item h3 {
  font-size: 0.8rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.2rem;
}

.info-item p {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Accesos Directos a Secciones AIP */
.quick-sections-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.quick-sections-card h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.section-button {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
  transition: var(--transition);
}

.section-button:hover {
  background: var(--primary-light);
  border-color: var(--border-focus);
}

.section-tag {
  background: var(--primary);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
}

.section-button span {
  font-size: 0.85rem;
  font-weight: 600;
}

/* Tarjeta de Soporte */
.support-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.support-text h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.support-text p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.support-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.support-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.support-btn:hover {
  background: #e2e8f0;
}

/* Pie de página */
.page-footer {
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-light);
}

.page-footer a {
  color: var(--primary);
  text-decoration: none;
}

.page-footer a:hover {
  text-decoration: underline;
}

/* Toast flotante */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #0f172a;
  color: #ffffff;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: all 0.25s ease;
  z-index: 1000;
  pointer-events: none;
}

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

/* Ajustes Móviles */
@media (max-width: 600px) {
  .top-header {
    padding: 0.65rem 0.75rem;
  }

  .brand-info h2 {
    font-size: 0.85rem;
  }

  .status-pill {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
  }

  .main-card {
    padding: 1.5rem 1rem;
  }

  .main-card h1 {
    font-size: 1.35rem;
  }

  .btn-aip-access {
    font-size: 1rem;
    padding: 0.85rem 1.25rem;
  }

  .info-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .support-card {
    flex-direction: column;
    align-items: stretch;
  }

  .support-actions {
    flex-direction: column;
  }

  .support-btn {
    justify-content: center;
  }
}
