﻿* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f2f2f2;
}

header {
    background: #0d6efd;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-login {
    background: white;
    color: #0d6efd;
    padding: 10px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
}

main {
    padding: 20px;
}

.titulo {
    text-align: center;
    margin-bottom: 20px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

    .card img {
        width: 90px;
        height: 90px;
        border-radius: 50%;
        object-fit: cover;
    }

.whatsapp {
    display: block;
    margin-top: 15px;
    background: #25d366;
    color: white;
    padding: 12px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
}

@media (max-width: 600px) {
    header {
        flex-direction: column;
        gap: 10px;
    }

    .btn-login {
        width: 100%;
        text-align: center;
    }
}

/* LOADER */
.loader {
    width: 50px;
    height: 50px;
    border: 6px solid #ddd;
    border-top: 6px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 40px auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 10px;
}

/* LOGIN */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.login-card {
    background: white;
    padding: 30px;
    width: 100%;
    max-width: 350px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

    .login-card h2 {
        text-align: center;
        margin-bottom: 20px;
    }

    .login-card input {
        width: 100%;
        padding: 12px;
        margin-bottom: 15px;
        border-radius: 4px;
        border: 1px solid #ccc;
    }

    .login-card button {
        width: 100%;
        padding: 12px;
        background: #0d6efd;
        color: white;
        border: none;
        border-radius: 4px;
        font-size: 16px;
        cursor: pointer;
    }

        .login-card button:hover {
            opacity: 0.9;
        }

.error {
    color: red;
    text-align: center;
    margin-top: 10px;
}
/* DASHBOARD */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #0d6efd;
    color: white;
}

    .dashboard-header button {
        background: white;
        color: #0d6efd;
        border: none;
        padding: 8px 12px;
        border-radius: 4px;
        cursor: pointer;
    }

.dashboard-container {
    padding: 20px;
}

.dashboard-actions {
    margin-bottom: 20px;
}

    .dashboard-actions button {
        background: #198754;
        color: white;
        padding: 10px 14px;
        border: none;
        border-radius: 4px;
        cursor: pointer;
    }

/* GRID AVALÚOS */
.avaluos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.avaluo-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

    .avaluo-card h4 {
        margin-bottom: 8px;
    }

/* LOADER */
.loader {
    border: 5px solid #eee;
    border-top: 5px solid #0d6efd;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin: 30px auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}


/* IMAGEN AVALÚO */
.avaluo-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 10px;
}

.avaluo-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

/* RESET */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f2f2f2;
}

/* HEADER */
.dashboard-header {
    background: #0d6efd;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .dashboard-header button {
        background: white;
        color: #0d6efd;
        border: none;
        padding: 8px 14px;
        border-radius: 4px;
        cursor: pointer;
        font-weight: bold;
    }

/* CONTENEDOR GENERAL */
.dashboard-container {
    padding: 20px;
}

/* FORM REGISTRO */
.registro-container {
    max-width: 1200px;
    margin: auto;
}

.registro-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    align-items: flex-start;
}

/* PANEL FOTOS */
.fotos-panel {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 90px;
}

.foto-add {
    display: block;
    text-align: center;
    padding: 12px;
    background: #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    margin-bottom: 15px;
}

.preview-fotos {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.foto-preview {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #ddd;
}

/* PANEL FORM */
.form-panel {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

    .form-panel h4 {
        margin-top: 25px;
        margin-bottom: 10px;
        border-bottom: 1px solid #eee;
        padding-bottom: 5px;
    }

    .form-panel input,
    .form-panel select {
        width: 100%;
        padding: 12px;
        margin-bottom: 12px;
        border-radius: 4px;
        border: 1px solid #ccc;
    }

/* BOTONES */
.acciones {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

    .acciones button {
        flex: 1;
        padding: 14px;
        font-size: 16px;
        border-radius: 6px;
        border: none;
        cursor: pointer;
        font-weight: bold;
    }

        .acciones button:first-child {
            background: #ffc107;
            color: black;
        }

        .acciones button:last-child {
            background: #198754;
            color: white;
        }

/* RESULTADO */
#resultado {
    margin-top: 20px;
    color: #198754;
    font-size: 20px;
    font-weight: bold;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .registro-layout {
        grid-template-columns: 1fr;
    }

    .fotos-panel {
        position: static;
    }

    .preview-fotos {
        flex-direction: row;
        overflow-x: auto;
    }

    .foto-preview {
        min-width: 120px;
    }
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 280px;
    background: white;
    border-left: 6px solid #198754;
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: 6px;
    z-index: 9999;
    animation: slideIn 0.4s ease;
}

    .toast strong {
        display: block;
        margin-bottom: 5px;
    }

    .toast p {
        font-size: 14px;
        margin-bottom: 10px;
    }

.progress {
    height: 5px;
    background: #ddd;
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: #198754;
    animation: load 3s linear forwards;
}

.hidden {
    display: none;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes load {
    to {
        width: 100%;
    }
}

/* PANEL IZQUIERDO */
.fotos-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* BOTÓN AGREGAR FOTO */
.foto-add {
    margin-bottom: 10px;
}

/* CONTENEDOR DE FOTOS */
.preview-fotos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    padding: 6px;
}

/* CADA FOTO */
.foto-item {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3; /* 👈 forma tipo inmueble */
}

    /* IMAGEN */
    .foto-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 8px;
        box-shadow: 0 3px 6px rgba(0,0,0,0.15);
    }

    /* BOTÓN ELIMINAR */
    .foto-item button {
        position: absolute;
        top: 8px;
        right: 8px;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        border: none;
        background: rgba(0,0,0,0.65);
        color: white;
        font-size: 15px;
        cursor: pointer;
    }

        .foto-item button:hover {
            background: #dc3545;
        }

/* 📱 MÓVIL */
@media (max-width: 768px) {
    .preview-fotos {
        grid-template-columns: 1fr;
    }

    .foto-item {
        aspect-ratio: 16 / 9;
    }
}
.detalle-header {
    display: flex;
    justify-content: space-between;
    padding: 15px 25px;
    background: #1e293b;
    color: #fff;
}

.detalle-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
}

/* 📸 GALERÍA */
.galeria {
    background: #f1f5f9;
    padding: 10px;
    border-radius: 12px;
}

.galeria-fotos {
    display: flex;
    gap: 12px;
    overflow-x: auto;
}

    .galeria-fotos img {
        height: 220px;
        border-radius: 10px;
        object-fit: cover;
        flex-shrink: 0;
    }

/* 📄 TARJETA */
.detalle-card {
    background: #fff;
    border-radius: 14px;
    padding: 25px;
    box-shadow: 0 8px 20px rgba(0,0,0,.08);
}

.detalle-evaluador {
    background: #f8fafc;
    padding: 12px;
    border-left: 4px solid #2563eb;
    margin-bottom: 20px;
}

.detalle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.valor-final {
    margin-top: 25px;
    padding: 20px;
    text-align: center;
    background: #2563eb;
    color: #fff;
    border-radius: 12px;
    font-size: 20px;
}

.detalle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-back {
    all: unset; /* 🔥 rompe herencias */
    cursor: pointer;
    background: #ffffff;
    color: #2563eb;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0,0,0,.12);
    transition: all .25s ease;
}

    .btn-back:hover {
        background: #2563eb;
        color: white;
        transform: translateX(-3px);
    }

.loader-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 5px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loader-overlay p {
    font-weight: 600;
    color: #374151;
}

.hidden {
    display: none !important;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.perfil-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

    .perfil-mini img {
        width: 38px;
        height: 38px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid #ddd;
    }

    .perfil-mini span {
        font-weight: 600;
    }

    .perfil-container {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.perfil-card {
    background: #fff;
    padding: 30px;
    border-radius: 14px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 10px 30px rgba(0,0,0,.1);
}

.perfil-foto {
    text-align: center;
    margin-bottom: 100px;
}

.perfil-foto img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ddd;
}

.btn-cambiar-foto {
    display: inline-block;
    margin-top: 10px;
    background: #2563eb;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
}

#perfilForm label {
    display: block;
    margin-top: 12px;
    font-weight: 600;
}

#perfilForm input {
    width: 100%;
    padding: 8px;
    margin-top: 4px;
}

#perfilForm button {
    margin-top: 20px;
    width: 100%;
    padding: 10px;
}

.perfil-foto-wrapper {
    width: 45px;
    height: 45px;
    margin: 0 auto 15px;
    
}

.perfil-foto {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.perfil-icono {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.hidden {
    display: none;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    width: 320px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

.modal-actions {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
}

.btn-cancelar {
    background: #e5e7eb;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-eliminar {
    background: #dc2626;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
}

.hidden {
    display: none;
}
.avaluo-card {
    position: relative;
}

.btn-delete {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #0d6efd;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
}



.btn-volver {
    margin-top: 20px;
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: none;
    background: #e5e7eb;
    cursor: pointer;
}

.login-links {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

    .login-links a {
        color: #2563eb;
        text-decoration: none;
        font-size: 14px;
        display:block;
        cursor: pointer;
    }

        .login-links a:hover {
            text-decoration: underline;
        }


/*.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    background: #1f2937;
    color: white;
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    width: 260px;
    box-shadow: 0 10px 25px rgba(0,0,0,.2);
}

.toast-bar {
    height: 4px;
    background: #2563eb;
    margin-top: 10px;
    border-radius: 2px;
    animation: fill 3s linear;
}*/

@keyframes fill {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

#mensaje{
    text-align:center;
}