/* ============================================================
   KineApp · Hoja de estilos global
   ============================================================ */

:root { 
    --kine-blue: #1e3a8a;         
    --kine-blue-dark: #172554;    
    --kine-blue-btn: #2563eb;     
    --kine-blue-btn-hover: #1d4ed8;
    --kine-red: #dc2626;          
    --kine-gray: #64748b;

    --kine-bg-soft: #f1f5f9;
    --kine-border: #e2e8f0;

    --kine-radius: 10px;
    --kine-radius-lg: 18px;
}


/* COMPARTIDOS */

.btn-kine {
    background: var(--kine-blue-btn);
    border: none;
    padding: 0.7rem;
    font-weight: 600;
    border-radius: var(--kine-radius);
    color: #fff;
}
.btn-kine:hover {
    background: var(--kine-blue-btn-hover);
    color: #fff;
}

.btn-kine-outline {
    padding: 0.7rem;
    font-weight: 600;
    border-radius: var(--kine-radius);
    border: 1px solid var(--kine-blue-btn);
    color: var(--kine-blue-btn);
    background: transparent;
}
.btn-kine-outline:hover {
    background: var(--kine-blue-btn);
    color: #fff;
}


/* REUTILIZABLES*/

/* Logo cuadrado "K"  */
.kine-logo {
    width: 72px;
    height: 72px;
    background: var(--kine-red);
    color: #fff;
    font-size: 2.4rem;
    font-weight: 700;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.4);
}

/* (login, formularios en general) */
.kine-input-group .form-control,
.kine-input-group .input-group-text {
    background-color: var(--kine-bg-soft);
    border-color: var(--kine-border);
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}
.kine-input-group .input-group-text {
    color: var(--kine-gray);
}
.kine-input-group .form-control:focus {
    background-color: #fff;
    box-shadow: none;
    border-color: var(--kine-blue-btn);
}
.kine-input-group:focus-within .input-group-text {
    background-color: #fff;
    border-color: var(--kine-blue-btn);
}

/* Label */
.kine-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--kine-gray);
    text-transform: uppercase;
}

/* Requisitos de contraseña: se muestran siempre y se van marcando al escribir.
   Antes no se decían en ninguna parte y la persona solo se enteraba al enviar,
   con un mensaje que nombraba una regla a la vez. */
.pw-reqs {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
}

.pw-reqs li {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.74rem;
    color: var(--kine-gray);
    transition: color 0.15s ease;
}

.pw-reqs li i {
    font-size: 0.7rem;
}

.pw-reqs li.ok {
    color: #1d7a45;
}

.pw-reqs li.falta {
    color: #b42318;
    font-weight: 600;
}

/* Separador */
.kine-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--kine-gray);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}
.kine-divider::before,
.kine-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid var(--kine-border);
}
.kine-divider span { padding: 0 1rem; }

.toggle-password { cursor: pointer; }


/* Página Login */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: url('/assets/img/kine-login.png') center/cover no-repeat fixed;
    position: relative;
    /* El body ya mide 100vh y el .container le sumaba encima los 3rem de arriba
       y de abajo del py-5, así que la página siempre terminaba un poco más alta
       que la pantalla y aparecía una barra de scroll por ~96px. Se neutraliza
       ese padding y el centrado vertical lo sigue haciendo el align-items. */
    padding-block: 0;
}

.login-page > .container {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

/* En un portátil de 1366x768 —la resolución más común— el conjunto medía 775px
   contra 768 disponibles y aparecía la barra por apenas unos pixeles. Se recorta
   el aire alrededor de la marca, que es de donde sobra, en vez de achicar la
   tarjeta o el texto. */
@media (max-height: 820px) {
    .login-page > .container {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    .login-page .login-brand { margin-bottom: 1rem !important; }
    .login-page .kine-logo { margin-bottom: 0.75rem !important; }
    .login-page .login-footer { margin-top: 1rem !important; }
}

/* Pantallas aún más bajas (1280x720 y portátiles con la barra del navegador):
   se achica el logo y se juntan los campos para no llegar al scroll. */
@media (max-height: 740px) {
    .login-page .kine-logo {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
        margin-bottom: 0.5rem !important;
    }
    .login-page .login-title { font-size: 1.6rem; }
    .login-page .login-card-header { padding: 1.1rem 1.5rem 0.9rem; }
    .login-page .card-body { padding: 1.25rem !important; }
}

/* Capa azul semitransparente sobre la foto */
.login-page .login-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.75), rgba(23, 37, 84, 0.8));
    z-index: 0;
    /* Es solo decorativo: cubre toda la pantalla, así que sin esto se come los
       clics del formulario si el contenido no alcanza a quedar por encima
       (pasa si el CSS de Bootstrap del CDN no carga). Verificado: con el CDN
       bloqueado, el botón de iniciar sesión se volvía inclicable y no se podía
       entrar a la app. */
    pointer-events: none;
}

.login-page .login-brand { color: #fff; }

.login-page .login-title {
    font-weight: 700;
    font-size: 2rem;
    letter-spacing: 0.5px;
}
.login-page .login-subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
}
.login-page .login-subtitle-sm {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-bottom: 0;
}

.login-page .login-card {
    border-radius: var(--kine-radius-lg);
    overflow: hidden;
}
.login-page .login-card-header {
    background: var(--kine-blue);
    color: #fff;
    padding: 1.5rem 1.5rem 1.25rem;
}

.login-page .login-footer {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.8rem;
}

/* Panel de acceso rápido (demo) */
@media (min-width: 768px) {
    .demo-panel-offset { margin-top: 195px; }
}


/* Componentes */

/* Botones tipo toggle Sí/No */
.btn-kine-toggle {
    border: 1px solid var(--kine-border);
    background: #fff;
    color: var(--kine-gray);
    min-width: 64px;
    font-weight: 600;
    border-radius: var(--kine-radius) !important;
    margin-right: 0.5rem;
    padding: 0.4rem 1.2rem;
}
.kine-toggle .btn-check:checked + .btn-kine-toggle {
    background: var(--kine-blue-btn);
    border-color: var(--kine-blue-btn);
    color: #fff;
}

/* seleccionables (localidades) */
.btn-kine-chip {
    border: 1px solid var(--kine-blue-btn);
    background: #fff;
    color: var(--kine-blue-btn);
    border-radius: 999px;
    padding: 0.35rem 1.1rem;
    font-size: 0.9rem;
    font-weight: 500;
}
.btn-check:checked + .btn-kine-chip {
    background: var(--kine-blue-btn);
    color: #fff;
}
.btn-check:disabled + .btn-kine-chip {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Zona de subida de archivos */
.kine-upload {
    display: block;
    border: 1.5px dashed #c7d2e5;
    background: var(--kine-bg-soft);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--kine-blue-btn);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.kine-upload:hover {
    border-color: var(--kine-blue-btn);
    background: #e9eff8;
}
.kine-upload i { font-size: 1.3rem; }
.kine-upload-text { font-size: 0.9rem; font-weight: 500; }
.kine-upload.has-file {
    border-color: #16a34a;
    color: #16a34a;
}

/* Columna de upload */
.kine-upload-col {
    display: flex;
    flex-direction: column;
}

/* Preview de archivo ya cargado (reemplaza la dropzone) */
.kine-upload-preview {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--kine-blue-100, #c7d2e5);
    background: var(--kine-bg-soft);
}
.kine-upload-preview.active {
    display: flex;
}
.kine-upload-preview-thumb {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 6px;
    border: 1px solid #dbe3f0;
    object-fit: cover;
    background: #fff;
}
.kine-upload-preview-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 6px;
    border: 1px solid #dbe3f0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--kine-blue-btn);
    font-size: 1.1rem;
}
.kine-upload-preview-info {
    flex: 1;
    min-width: 0;
}
.kine-upload-preview-name {
    font-size: 0.85rem;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}
.kine-upload-preview-status {
    font-size: 0.75rem;
    color: #16a34a;
    margin: 0;
}
.kine-upload-preview-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    padding: 4px;
    flex-shrink: 0;
}
.kine-upload-preview-remove:hover {
    color: #1f2937;
}


/* Página de registro */

/* Misma portada que el login, para que registrarse no se sienta una pantalla
   ajena a la aplicación. La foto va fija y el velo azul la atenúa lo suficiente
   para que el texto de las tarjetas se lea sin esfuerzo. */
.signup-page {
    min-height: 100vh;
    background: url('/assets/img/kine-login.png') center/cover no-repeat fixed;
    position: relative;
}

.signup-page::before {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.82), rgba(23, 37, 84, 0.88));
    z-index: 0;
    pointer-events: none;
}

/* El contenido sobre el velo */
.signup-page > .container {
    position: relative;
    z-index: 1;
}

.signup-page .signup-card {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(2px);
}

.signup-back {
    color: var(--kine-blue-btn);
    text-decoration: none;
    font-weight: 500;
}
.signup-back:hover { text-decoration: underline; }

/* Sobre la portada el azul sólido se perdía contra el velo: se usa un vidrio
   claro que despega el encabezado del fondo sin competir con él. */
.signup-header {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(6px);
    color: #fff;
    border-radius: var(--kine-radius-lg);
    padding: 1.75rem 2rem;
}

.signup-page .signup-back {
    color: #fff;
    opacity: 0.85;
}
.signup-page .signup-back:hover { opacity: 1; }

.signup-card {
    border-radius: var(--kine-radius-lg);
}

.signup-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--kine-blue-dark);
    margin-bottom: 1.25rem;
}

/* Distingue las secciones que se pueden completar después (Hepatitis B y
   COVID) de las obligatorias, para que se note antes de llenar el formulario. */
.signup-badge-opcional {
    display: inline-block;
    margin-left: .5rem;
    padding: .15rem .55rem;
    border-radius: 999px;
    background: #eef2f9;
    color: #64748b;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
    vertical-align: middle;
}


/* Layout con sidebar */

.app-shell {
    display: flex;
    min-height: 100vh;
    background: #eef2f9;
    margin: 0;
}

/*  Sidebar  */
.app-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #0f2557 0%, #0a1a3f 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
}

.app-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.5rem 1.5rem;
}
.kine-logo-sm {
    width: 44px;
    height: 44px;
    font-size: 1.4rem;
    border-radius: 12px;
    box-shadow: none;
    flex-shrink: 0;
}
.app-brand-name { font-weight: 700; font-size: 1.1rem; line-height: 1.1; }
.app-brand-sub  { font-size: 0.72rem; opacity: 0.6; }

.app-nav { flex: 1; margin-top: 0.5rem; }
.app-nav-section {
    font-size: 0.68rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.45;
    margin: 1.25rem 0.75rem 0.5rem;
}
.app-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 0.15rem;
    transition: background .15s, color .15s;
}
.app-nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.app-nav-item.active {
    background: #fff;
    color: var(--kine-blue-dark);
    font-weight: 600;
}
.app-nav-item.active i { color: var(--kine-red); }
.app-nav-item i { font-size: 1.1rem; }

/* Tarjeta de usuario abajo */
.app-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem;
    border-radius: 12px;
    background: rgba(0,0,0,0.25);
    border-top: 1px solid rgba(255,255,255,0.08);
}
.app-user-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--kine-blue-btn);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 0.85rem;
    flex-shrink: 0;
}
.app-user-info { flex: 1; min-width: 0; }
.app-user-name { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-user-rol  { font-size: 0.72rem; opacity: 0.6; }
.app-user-logout { color: rgba(255,255,255,0.7); font-size: 1.1rem; }
.app-user-logout:hover { color: #fff; }

/*  Área principal  */
.app-main {
    flex: 1;
    min-width: 0;
    padding: 1.75rem 2.25rem;
}

/* Hero (dashboard) */
.app-hero {
    background: var(--kine-blue);
    color: #fff;
    border-radius: var(--kine-radius-lg);
    padding: 1.75rem 2rem;
    margin-bottom: 1.75rem;
}
.app-hero-title { font-weight: 700; font-size: 1.6rem; margin-bottom: 0.35rem; }
.app-hero-sub   { opacity: 0.8; font-size: 0.95rem; }

/* Topbar (páginas internas) */
.app-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.75rem;
}
.app-page-title { font-weight: 700; font-size: 1.6rem; color: var(--kine-blue-dark); margin-bottom: 0.25rem; }
.app-page-sub   { color: var(--kine-gray); font-size: 0.95rem; }
.app-bell {
    width: 44px; height: 44px;
    border-radius: 50%;
    border: none;
    background: #e4e9f2;
    color: var(--kine-gray);
    flex-shrink: 0;
}
.app-bell:hover { background: #d7deec; }

.app-content { max-width: 1050px; }

.app-eyebrow {
    font-size: 0.72rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--kine-gray);
    margin-bottom: 0.75rem;
}

.app-card {
    border-radius: var(--kine-radius-lg);
    background: #fff;
}
.app-card-title { font-size: 1.2rem; font-weight: 700; color: var(--kine-blue-dark); margin-bottom: 1.25rem; }

/* Acceso rápido (dashboard) */
.app-quick-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    color: var(--kine-blue-btn);
    font-weight: 600;
    text-decoration: none;
    font-size: 1.05rem;
}
.app-quick-link i { font-size: 1.3rem; }
.app-quick-link:hover { color: var(--kine-blue-btn-hover); }

.app-note { background: #fbfcfe; }

.app-lock { color: var(--kine-gray); font-size: 0.85rem; }

/*  Tabla de notas  */
.app-table thead th {
    background: var(--kine-blue);
    color: #fff;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: 600;
    border: none;
    padding: 1rem 1.25rem;
}
.app-table tbody td {
    padding: 1rem 1.25rem;
    border-color: #eef2f8;
    font-size: 0.92rem;
}
.app-table tbody tr:hover { background: #f7f9fd; }
.app-table thead th:first-child { border-top-left-radius: var(--kine-radius-lg); }
.app-table thead th:last-child  { border-top-right-radius: var(--kine-radius-lg); }

.app-nota { color: var(--kine-blue-btn); font-weight: 700; }
.app-nota-baja { color: var(--kine-red); }

/* Campo Promedio (calculado, solo lectura) */
.app-promedio {
    background: #eef2f9;
    border-color: #e2e8f0;
    color: var(--kine-blue-btn);
    font-weight: 700;
    font-size: 1.15rem;
    text-align: center;
}
.app-promedio:focus { background: #eef2f9; box-shadow: none; }

/* Estado reprobatorio (< 4.0) */
.app-promedio-baja {
    background: #fde8e8;
    border-color: #f5c6c6;
    color: var(--kine-red);
}
.app-promedio-baja:focus { background: #fde8e8; }
.app-nota-input-baja {
    color: var(--kine-red);
    font-weight: 600;
}

/* Badges de estado */
.app-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}
.app-badge-pendiente { background: #fde8e8; color: #c0392b; }
.app-badge-ingresada { background: #e5efe5; color: #2e7d32; }

/* Selector de tipo de cuenta (registro) */
.signup-select-card {
    background: #fff;
    border-radius: var(--kine-radius-lg);
    transition: transform 0.15s, box-shadow 0.15s;
}
.signup-select-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18) !important;
}
.signup-select-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--kine-radius);
    background: #eef2ff;
    color: var(--kine-blue-btn);
    font-size: 1.1rem;
}
.signup-select-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--kine-blue-dark);
}
.signup-select-desc {
    font-size: 0.82rem;
    color: var(--kine-gray);
    line-height: 1.4;
}

/*  Responsive */
@media (max-width: 768px) {
    .app-shell { flex-direction: column; }
    .app-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        flex-direction: column;
    }
    .app-main { padding: 1.25rem; }
}

/* Panel de credenciales de demostración (login) */
.demo-cred-card {
    border: 1px solid var(--kine-border);
    border-radius: var(--kine-radius);
    padding: 0.75rem 0.9rem;
    background: var(--kine-bg-soft);
}
.demo-cred-role {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--kine-blue-dark);
    margin-bottom: 0.4rem;
}
.demo-cred-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.25rem 0;
}
.demo-cred-value {
    font-size: 0.82rem;
    color: #334155;
    font-family: 'Courier New', monospace;
}
.demo-cred-copy {
    border: none;
    background: transparent;
    color: var(--kine-blue-btn);
    cursor: pointer;
    padding: 0.15rem 0.35rem;
    flex-shrink: 0;
}
.demo-cred-use {
    font-size: 0.8rem;
    padding: 0.45rem;
}
.demo-cred-footer {
    font-size: 0.72rem;
    color: var(--kine-gray);
    margin: 0.75rem 0 0;
    text-align: center;
}
