/* =============================================
   CIDE — Variables de identidad visual (manual de marca)
   ============================================= */
:root {
  --cide-primary:   #2E7DA1;   /* azul institucional oficial  */
  --cide-secondary: #38BCB0;   /* teal secundario oficial     */
  --cide-dark:      #1A4E6E;   /* azul oscuro derivado        */
  --cide-light:     #F0F7FA;   /* blanco azulado suave        */
  --cide-text:      #1A3A4A;   /* texto oscuro derivado       */
}

/* =============================================
   Admin — Vista detalle de inscripción
   ============================================= */
.detail-card {
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.detail-card-header {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid #edf2f7;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--cide-dark);
  background: #fff;
}

.detail-card-body {
  padding: 1.25rem;
}

.detail-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #8fa3ad;
  margin-bottom: 0.2rem;
}

.detail-value {
  font-size: 0.9rem;
  color: var(--cide-text);
  word-break: break-word;
}

.detail-empty {
  color: #c0cdd3;
  font-style: italic;
}

.detail-mono {
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  color: #607d8b;
}

/* Audit timeline */
.audit-step {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid #f0f4f8;
}

.audit-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 0.3rem;
  flex-shrink: 0;
}

.audit-dot-ok    { background: #10b981; }
.audit-dot-err   { background: #ef4444; }
.audit-dot-empty { background: #dce6ea; }

.audit-step-label { font-size: 0.84rem; font-weight: 600; color: var(--cide-text); }
.audit-step-meta  { font-size: 0.78rem; color: #8fa3ad; margin-top: 0.1rem; }
.audit-step-by    { font-size: 0.75rem; color: var(--cide-primary); margin-top: 0.1rem; }

/* =============================================
   Admin — Toast de feedback
   ============================================= */
.toast-admin {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  z-index: 9999;
  padding: 0.85rem 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 380px;
  animation: toastIn 0.3s ease;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.toast-admin-ok {
  background: #ecfdf5;
  color: #065f46;
  border-left: 4px solid #10b981;
}

.toast-admin-error {
  background: #fef2f2;
  color: #991b1b;
  border-left: 4px solid #ef4444;
}

.toast-admin-hide {
  opacity: 0;
  transform: translateY(8px);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* =============================================
   Base
   ============================================= */
html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin-bottom: 0;
  background-color: var(--cide-light);
  color: var(--cide-text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
}

/* =============================================
   Headings
   ============================================= */
h1, h2, h3, h4, h5, h6 {
  color: var(--cide-dark);
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.4rem; }

/* =============================================
   Links
   ============================================= */
a {
  color: var(--cide-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--cide-secondary);
}

/* =============================================
   Focus (conservado de Bootstrap, ajustado)
   ============================================= */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--cide-primary);
  outline: none;
}

/* =============================================
   Botones CIDE
   ============================================= */
.btn-cide-primary {
  background-color: var(--cide-primary);
  border-color: var(--cide-primary);
  color: #fff;
  font-weight: 600;
  border-radius: 6px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.btn-cide-primary:hover,
.btn-cide-primary:focus {
  background-color: var(--cide-secondary);
  border-color: var(--cide-secondary);
  color: #fff;
}

.btn-cide-outline {
  background-color: transparent;
  border: 2px solid var(--cide-primary);
  color: var(--cide-primary);
  font-weight: 600;
  border-radius: 6px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-cide-outline:hover,
.btn-cide-outline:focus {
  background-color: var(--cide-primary);
  color: #fff;
}

/* =============================================
   Cards
   ============================================= */
.card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(31, 37, 41, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(31, 37, 41, 0.14);
}

.card-title {
  color: var(--cide-dark);
  font-weight: 600;
}

/* =============================================
   Sections
   ============================================= */
.section {
  padding: 4rem 0;
}

.section-light {
  background-color: var(--cide-light);
}

.section-dark {
  background-color: var(--cide-dark);
  color: #fff;
}

.section-title {
  color: var(--cide-primary);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: #607D8B;
  margin-bottom: 2.5rem;
}

/* =============================================
   Navbar
   ============================================= */
.navbar {
  background-color: var(--cide-dark) !important;
  padding: 0.75rem 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff !important;
  letter-spacing: 1px;
}

.navbar-brand span {
  color: var(--cide-secondary);
}

.nav-link {
  color: rgba(255, 255, 255, 0.85) !important;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.4rem 0.6rem !important;
  border-radius: 4px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: #fff !important;
  background-color: rgba(255, 255, 255, 0.1);
}

/* =============================================
   Footer
   ============================================= */
footer {
  background-color: var(--cide-dark) !important;
  color: rgba(255, 255, 255, 0.75);
  padding-top: 3rem;
  padding-bottom: 1.5rem;
}

footer h5,
footer h6 {
  color: #fff;
  letter-spacing: 0.5px;
}

footer a {
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.2s ease;
}

footer a:hover {
  color: var(--cide-secondary);
}

footer hr {
  border-color: rgba(255, 255, 255, 0.12);
}

footer .text-muted {
  color: rgba(255, 255, 255, 0.5) !important;
}

/* =============================================
   Login page — split layout
   ============================================= */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--cide-light);
}

/* Full-height split container */
.login-split {
  flex: 1;
  display: flex;
  min-height: 0;
}

/* ?? Left: brand panel ?? */
.login-brand {
  flex: 1;
  background: linear-gradient(150deg, var(--cide-primary) 0%, var(--cide-dark) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
  position: relative;
  overflow: hidden;
}

/* Decorative circles */
.login-brand::before,
.login-brand::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  pointer-events: none;
}
.login-brand::before {
  width: 380px;
  height: 380px;
  top: -100px;
  right: -100px;
}
.login-brand::after {
  width: 280px;
  height: 280px;
  bottom: -80px;
  left: -70px;
}

.login-brand-logo {
  max-width: 240px;
  width: 100%;
  position: relative;
  z-index: 1;
}

.login-brand-badge {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.72rem;
  letter-spacing: 2.8px;
  text-transform: uppercase;
  font-weight: 500;
  margin: 1.5rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  text-align: center;
  position: relative;
  z-index: 1;
}

/* ?? Right: form panel ?? */
.login-form-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
  max-width: 480px;
  box-shadow: -4px 0 30px rgba(0, 0, 0, 0.06);
}

.login-back-bar {
  padding: 1rem 2rem 0.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.login-form-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.5rem 2.5rem 2rem;
}

.login-form-heading {
  color: var(--cide-dark);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.login-form-sub {
  color: #607d8b;
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

.login-form-inner .form-label {
  color: var(--cide-text);
  font-weight: 600;
  font-size: 0.82rem;
}

.login-form-inner .form-control {
  border-color: #dce6ea;
  border-radius: 0.5rem;
}

.login-form-inner .form-control:focus {
  border-color: var(--cide-secondary);
  box-shadow: 0 0 0 0.2rem rgba(56, 188, 176, 0.18);
}

.login-note {
  font-size: 0.73rem;
  color: #8fa3ad;
  text-align: center;
  margin-top: 1rem;
  margin-bottom: 0;
  letter-spacing: 0.5px;
}

/* ?? Back link ?? */
.back-link {
  color: var(--cide-primary);
  font-size: 0.82rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--cide-dark);
}

/* ?? Mobile: stack vertically ?? */
@media (max-width: 767px) {
  .login-split {
    flex-direction: column;
  }
  .login-brand {
    padding: 2.5rem 1.5rem 2rem;
    flex: none;
  }
  .login-brand-logo {
    max-width: 170px;
  }
  .login-form-side {
    max-width: 100%;
    box-shadow: none;
  }
  .login-form-inner {
    padding: 1.75rem 1.5rem 1.25rem;
    justify-content: flex-start;
  }
}

/* =============================================
   ws-dev footer credit
   ============================================= */
.ws-footer {
  padding: 0.85rem 1rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--cide-text);
  background: var(--cide-light) !important;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.ws-footer a {
  color: var(--cide-primary);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: color 0.2s ease;
}

.ws-footer a:hover {
  color: var(--cide-secondary);
}

.ws-footer .ws-logo {
  height: 26px;
  width: auto;
  vertical-align: middle;
  margin: 0 0.35rem;
}

/* password toggle button */
.password-toggle {
  cursor: pointer;
  background: transparent;
  border: 1px solid #dce6ea;
  border-left: none;
  border-radius: 0 0.5rem 0.5rem 0;
  padding: 0 0.85rem;
  color: #aaa;
  transition: color 0.2s ease;
}

.password-toggle:hover {
  color: var(--cide-primary);
}

/* =============================================
   Admin panel — stat cards
   ============================================= */
.admin-stat-card {
  border-left: 4px solid transparent;
  transition: box-shadow 0.2s ease;
}
.admin-stat-card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1) !important;
  transform: none; /* override base card hover */
}
.admin-stat-card .stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.admin-stat-card .stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #8fa3ad;
}
.admin-stat-card .stat-value {
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.1;
  margin-top: 0.2rem;
}
.admin-stat-card .stat-sub {
  font-size: 0.78rem;
  margin-top: 0.3rem;
}

/* =============================================
   Admin panel — quick action cards
   ============================================= */
.admin-action-card {
  border-left: 3px solid transparent;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  text-decoration: none !important;
}
.admin-action-card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1) !important;
  transform: none;
}
.admin-action-card .action-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

/* =============================================
   Admin panel — inscripciones table
   ============================================= */
.admin-table-card {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.admin-table-card thead th {
  background: var(--cide-dark);
  color: rgba(255, 255, 255, 0.82);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border: none;
  padding: 0.9rem 1rem;
  white-space: nowrap;
}

.admin-table-card tbody td {
  border-color: #f0f4f8;
  padding: 0.8rem 1rem;
  vertical-align: middle;
}

.admin-table-card tbody tr:hover td {
  background: #f8fafc;
}

/* Toolbar (search + count) */
.table-toolbar .search-box .form-control:focus {
  border-color: var(--cide-secondary);
  box-shadow: 0 0 0 0.18rem rgba(56, 188, 176, 0.18);
}

/* Icon action buttons */
.btn-action {
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-size: 0.8rem;
  border: none;
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn-action:hover {
  transform: translateY(-1px);
  opacity: 0.88;
  color: #fff;
}

/* =============================================
   SweetAlert2 — CIDE theme
   ============================================= */
.swal2-popup {
  border-radius: 1rem !important;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif !important;
  padding: 2rem !important;
}

.swal2-title {
  color: var(--cide-dark) !important;
  font-size: 1.15rem !important;
  font-weight: 700 !important;
}

.swal2-html-container {
  color: #607d8b !important;
  font-size: 0.9rem !important;
}

.swal2-confirm,
.swal2-cancel {
  border-radius: 0.5rem !important;
  font-weight: 600 !important;
  font-size: 0.88rem !important;
  padding: 0.5rem 1.25rem !important;
}

.swal2-icon {
  border-width: 2px !important;
}
