/* ============================================================
   CLIENTE.CSS — Hoja de estilos simplificada
   +Sol Energía · Subdominio de clientes
   (solo lo que usan index.php y panel_cliente.php)
   ============================================================ */

/* ── Variables ────────────────────────────────────────────── */
:root {
    --blue-main:     #3b82f6;
    --blue-dark:     #285192;
    --blue-light:    #e9f2ff;
    --blue-mid:      #afceff;
    --blue-bg:       #d2e3ffd3;

    --text-dark:     #2c3e50;
    --border:        #e5e7eb;
    --border-light:  #e2e8f0;

    --bg-alt:        #fcfcfc;
    --white:         #ffffff;

    --radius:        10px;
    --radius-sm:     6px;
    --radius-xs:     4px;

    --shadow-card:   0 2px 5px rgba(0,0,0,0.05);
}

/* ── Reset base ──────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    background-color: var(--bg-alt);
    color: #333;
    font-family: 'Segoe UI', sans-serif;
    font-size: 14px;
    min-height: 100vh;
}

/* ── Alertas ─────────────────────────────────────────────── */
.alert-error {
    background-color: #fdf3f2;
    border: 1px solid #f9aca4;
    color: #e74c3c;
    padding: 10px;
    border-radius: var(--radius-xs);
    font-size: 14px;
    margin-bottom: 15px;
    text-align: center;
}
.alert-success {
    background: #e6f9f0;
    color: #1a7a45;
    border: 1px solid #a7e4c1;
    border-radius: 7px;
    padding: .65rem .9rem;
    margin-bottom: 1rem;
    font-size: .88rem;
}

/* ============================================================
   PÁGINA DE LOGIN
   ============================================================ */
.body-centered {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: var(--bg-alt);
}

.login-card {
    background: var(--white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    width: 100%;
    max-width: 350px;
    border-top: 5px solid var(--blue-main);
    box-sizing: border-box;
}
.login-logo {
    display: block;
    max-width: 275px;
    height: auto;
    margin: 0 auto 1rem;
}
.form-group { margin-bottom: 15px; }
.login-card label { display: block; margin-bottom: 5px; color: #666; font-size: 14px; }
.login-card input[type="text"],
.login-card input[type="password"] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xs);
    box-sizing: border-box;
    font-size: 14px;
}
.login-card input[type="text"]:focus,
.login-card input[type="password"]:focus {
    outline: none;
    border-color: var(--blue-main);
}
.pwd-container { position: relative; display: flex; gap: 5px; }
button#btn-mostrar {
    background: #f4f4f4;
    border: 1px solid var(--border-light);
    padding: 10px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-size: 12px;
    color: #555;
    font-weight: 500;
    transition: background 0.2s;
}
button#btn-mostrar:hover { background: var(--border-light); }

.btn-login-submit {
    width: 100%;
    background: var(--blue-main);
    color: white;
    border: none;
    padding: 12px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    margin-top: 10px;
    transition: background-color 0.2s ease;
}
.btn-login-submit:hover { background: var(--blue-dark); }

/* ============================================================
   PANEL DE CLIENTE
   ============================================================ */
.pc-wrap { max-width: 960px; margin: 0 auto; padding: 24px 16px; }

/* ── Bienvenida ── */
.pc-welcome { background: #fff; border-radius: 12px; border: 1px solid #eee; padding: 20px 24px; margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.pc-welcome-left { display: flex; align-items: center; gap: 16px; }
.pc-avatar { width: 50px; height: 50px; border-radius: 50%; background: #e3f2fd; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 700; color: #1565c0; flex-shrink: 0; }
.pc-welcome-name { font-size: 17px; font-weight: 700; color: #2c3e50; }
.pc-welcome-sub { font-size: 13px; color: #888; margin-top: 2px; }
.pc-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.pc-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 3px 9px; border-radius: 20px; border: 1px solid #e8e8e8; color: #666; background: #fafafa; }

/* ── Aviso notificaciones ── */
.pc-notif-alert { display: flex; align-items: flex-start; gap: 10px; background: #fff8e1; border: 1px solid #ffe082; border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; font-size: 13px; color: #7b5900; }

/* ── Stats ── */
.pc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 20px; }
.pc-stat { background: #fff; border-radius: 10px; border: 1px solid #eee; padding: 16px; text-align: center; }
.pc-stat-num { font-size: 26px; font-weight: 700; color: #2c3e50; margin-bottom: 4px; }
.pc-stat-lbl { font-size: 12px; color: #999; }

/* ── Layout 2 columnas ── */
.pc-two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 640px) { .pc-two-col { grid-template-columns: 1fr; } }

/* ── Tarjetas ── */
.pc-card { background: #fff; border-radius: 12px; border: 1px solid #eee; margin-bottom: 16px; overflow: hidden; }
.pc-card-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #f0f0f0; }
.pc-card-title { font-size: 14px; font-weight: 700; color: #2c3e50; display: flex; align-items: center; gap: 8px; }
.pc-count { font-size: 11px; padding: 3px 8px; border-radius: 10px; background: #e3f2fd; color: #1565c0; font-weight: 700; }
.pc-empty { text-align: center; padding: 24px; font-size: 13px; color: #bbb; }

/* ── Filas de información ── */
.pc-info-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 18px; border-bottom: 1px solid #f8f8f8; font-size: 13px; }
.pc-info-row:last-child { border-bottom: none; }
.pc-info-row label { color: #999; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; flex-shrink: 0; min-width: 100px; }
.pc-info-row span { color: #2c3e50; text-align: right; }

/* ── Acceso a planta ── */
.planta-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; border-bottom: 1px solid #f8f8f8; font-size: 13px; }
.planta-row:last-child { border-bottom: none; }
.planta-row label { color: #999; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; min-width: 90px; flex-shrink: 0; }
.planta-val { display: flex; align-items: center; gap: 8px; color: #2c3e50; font-weight: 600; }
.passwd-mask { letter-spacing: 3px; color: #bbb; font-size: 14px; }
.btn-reveal { background: none; border: 1px solid #e0e0e0; border-radius: 5px; padding: 3px 8px; font-size: 11px; color: #555; cursor: pointer; transition: background .15s; }
.btn-reveal:hover { background: #f4f6f8; }

/* ── Listas (citas, llamadas, incidencias, reclamaciones) ── */
.pc-list-item { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid #f8f8f8; font-size: 13px; }
.pc-list-item:last-child { border-bottom: none; }
.pc-list-ico { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.ico-blue   { background: #e3f2fd; color: #1565c0; }
.ico-green  { background: #e8f5e9; color: #2e7d32; }
.ico-gray   { background: #f4f6f8; color: #888; }
.pc-list-body  { flex: 1; min-width: 0; }
.pc-list-title { font-weight: 600; color: #2c3e50; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-list-sub   { font-size: 12px; color: #aaa; margin-top: 2px; }
.pc-list-transcript { font-size: 12px; color: #888; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }

/* ── Badges de estado ── */
.est-agendada { background: #e8f5e9; color: #2e7d32; font-size: 11px; padding: 3px 8px; border-radius: 10px; font-weight: 600; }
.est-pendiente{ background: #fff3e0; color: #e65100; font-size: 11px; padding: 3px 8px; border-radius: 10px; font-weight: 600; }
.est-reserva  { background: #e3f2fd; color: #1565c0; font-size: 11px; padding: 3px 8px; border-radius: 10px; font-weight: 600; }
.est-nula     { background: #fde8e8; color: #c62828; font-size: 11px; padding: 3px 8px; border-radius: 10px; font-weight: 600; }

/* ── Notificaciones ── */
.pc-notif-item { display: flex; align-items: flex-start; gap: 10px; padding: 12px 18px; border-bottom: 1px solid #f8f8f8; font-size: 13px; }
.pc-notif-item:last-child { border-bottom: none; }
.pc-notif-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.nc-unread { background: #1976d2; }
.nc-read   { background: #ccc; }
.pc-notif-body { flex: 1; }
.pc-notif-msg  { color: #333; line-height: 1.5; }
.pc-notif-time { font-size: 11px; color: #aaa; margin-top: 3px; }

/* ── Documentos por tipo ── */
.doc-tipo-section   { border-bottom: 1px solid #f0f0f0; }
.doc-tipo-section:last-child { border-bottom: none; }
.doc-tipo-header    { display: flex; align-items: center; justify-content: space-between; padding: 10px 18px; background: #fafafa; cursor: pointer; user-select: none; font-size: 13px; font-weight: 600; color: #2c3e50; gap: 8px; }
.doc-tipo-header:hover { background: #f4f6f8; }
.doc-tipo-label     { display: flex; align-items: center; gap: 8px; }
.doc-tipo-badge     { font-size: 11px; padding: 2px 7px; border-radius: 10px; background: #e3f2fd; color: #1565c0; font-weight: 700; }
.doc-tipo-arrow     { font-size: 11px; color: #aaa; transition: transform .2s; }
.doc-tipo-arrow.open { transform: rotate(180deg); }
.doc-tipo-body      { display: none; }
.doc-tipo-body.open { display: block; }

/* ── Botón de descarga ── */
.pc-dl-btn { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 5px 10px; border-radius: 6px; border: 1px solid #e0e0e0; background: #fff; color: #555; text-decoration: none; transition: background .15s; white-space: nowrap; }
.pc-dl-btn:hover { background: #f4f6f8; }

/* ── Fotos de la instalación ── */
.foto-grupo { border-bottom: 1px solid #f0f0f0; }
.foto-grupo:last-child { border-bottom: none; }
.foto-grupo-header { display: flex; align-items: center; gap: 8px; padding: 10px 18px; background: #fafafa; cursor: pointer; user-select: none; font-size: 13px; font-weight: 600; color: #2c3e50; }
.foto-grupo-header:hover { background: #f4f6f8; }
.foto-grupo-badge  { font-size: 11px; padding: 2px 7px; border-radius: 10px; background: var(--blue-light); color: var(--blue-dark); font-weight: 700; }
.foto-grupo-arrow  { font-size: 11px; color: #aaa; margin-left: auto; transition: transform .2s; }
.foto-grupo-arrow.open { transform: rotate(180deg); }
.foto-grupo-body   { display: none; padding: 14px 18px; }
.foto-grupo-body.open { display: block; }
.fotos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.foto-thumb-wrap   { border-radius: 8px; overflow: hidden; border: 1px solid #eee; background: #f8f8f8; }
.foto-thumb        { aspect-ratio: 4/3; overflow: hidden; }
.foto-thumb img    { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.foto-thumb:hover img { transform: scale(1.04); }
.foto-thumb-meta   { padding: 6px 8px; font-size: 11px; color: #888; background: #fafafa; border-top: 1px solid #f0f0f0; }
.foto-thumb-meta strong { display: block; color: #555; font-size: 11px; }
.foto-lightbox-link { display: block; width: 100%; }

/* ── Lightbox de fotos ── */
.lightbox-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 1000; align-items: center; justify-content: center; cursor: zoom-out; }
.lightbox-overlay.active { display: flex; }
.lightbox-img   { max-width: 90vw; max-height: 88vh; border-radius: 8px; box-shadow: 0 8px 48px rgba(0,0,0,.5); }
.lightbox-close { position: fixed; top: 16px; right: 20px; font-size: 28px; color: #fff; cursor: pointer; background: none; border: none; line-height: 1; }

/* ── Equipo de la instalación ── */
.equipo-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0; }
@media (max-width: 640px) { .equipo-grid { grid-template-columns: 1fr; } }
.equipo-bloque { padding: 14px 18px; border-right: 1px solid #f0f0f0; border-bottom: 1px solid #f0f0f0; }
.equipo-bloque:nth-child(3n) { border-right: none; }
.equipo-bloque-title { font-size: 11px; font-weight: 700; color: #999; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; display: flex; align-items: center; gap: 5px; }
.equipo-campo { font-size: 12px; color: #2c3e50; margin-bottom: 4px; }
.equipo-campo span { color: #888; font-size: 11px; }
.equipo-fecha { padding: 12px 18px; font-size: 12px; color: #888; border-top: 1px solid #f0f0f0; background: #fafafa; }

/* ── Mensajes de formularios (contraseña, incidencia, reclamación) ── */
.pwd-msg { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.pwd-ok  { background: #e6f9f0; color: #1a7f4b; border: 1px solid #a3e4c1; }
.pwd-err { background: #fff2f2; color: #c0392b; border: 1px solid #f5b7b1; }

/* ============================================================
   RESPONSIVE MÓVIL
   ============================================================ */
@media (max-width: 640px) {
    .body-centered { align-items: flex-start; padding-top: 40px; }
    .login-card    { padding: 24px 18px; }
    .fotos-grid    { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
    .equipo-grid   { grid-template-columns: 1fr; }
    .equipo-bloque { border-right: none; }
}