
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #111;
    color: #222;
    font-family: Arial, Helvetica, sans-serif;
}

.login-container {
    width: 100%;
    max-width: 430px;
    padding: 35px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 35px rgba(0, 0, 0, .35);
}

.logo {
    display: inline-flex;
    flex-direction: column;
    margin-bottom: 25px;
    color: #e60000;
    text-decoration: none;
}

.logo span {
    font-size: 36px;
    font-weight: 900;
    font-style: italic;
}

.logo small {
    color: #222;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 2px;
}

h1 {
    margin-bottom: 10px;
    font-size: 26px;
}

.login-container > p {
    color: #666;
    line-height: 1.5;
}

form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 25px;
}

label {
    margin-top: 8px;
    font-weight: bold;
}

input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
}

input:focus {
    outline: 2px solid #e60000;
    border-color: #e60000;
}

button {
    margin-top: 15px;
    padding: 13px;
    border: 0;
    border-radius: 6px;
    background: #e60000;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

button:hover {
    background: #bd0000;
}

#mensaje {
    color: #b00000;
    font-size: 14px;
}

.volver {
    display: inline-block;
    margin-top: 18px;
    color: #444;
    text-decoration: none;
}

.volver:hover {
    color: #e60000;
}


.panel-admin {
    min-height: 100vh;
    background: #f5f5f5;
    color: #171717;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 5%;
    background: #111;
    border-bottom: 3px solid #e00000;
}

.panel-header .logo {
    display: flex;
    flex-direction: column;
    color: #e00000;
    text-decoration: none;
    font-size: 30px;
    font-weight: 800;
    font-style: italic;
}

.panel-header .logo small {
    color: white;
    font-size: 10px;
    letter-spacing: 2px;
    font-style: normal;
}

.panel-header button,
#btnGuardar {
    padding: 11px 16px;
    border: 0;
    border-radius: 6px;
    background: #e00000;
    color: white;
    cursor: pointer;
}

.panel-header button {
    margin-left: 5px;
}

.panel-contenido {
    width: min(1100px, 92%);
    margin: 35px auto;
}

.admin-seccion {
    margin: 25px 0;
    padding: 25px;
    background: white;
    border: 1px solid #e3e3e3;
    border-radius: 12px;
    box-shadow: 0 4px 15px #0000000a;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

#formVehiculo label {
    display: block;
    margin: 12px 0 6px;
    font-weight: 600;
}

#formVehiculo input:not([type="checkbox"]),
#formVehiculo select,
#formVehiculo textarea {
    box-sizing: border-box;
    width: 100%;
    padding: 11px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font: inherit;
}

#formVehiculo fieldset {
    margin: 20px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
}

#formVehiculo fieldset label,
#formVehiculo > label:last-of-type {
    font-weight: normal;
}

#formVehiculo input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

#btnGuardar {
    margin-top: 18px;
}

.vehiculo-admin {
    margin: 12px 0;
    padding: 18px;
    border: 1px solid #ddd;
    border-left: 4px solid #e00000;
    border-radius: 8px;
}

.vehiculo-admin h3 {
    margin-top: 0;
}

@media (max-width: 600px) {
    .panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .admin-seccion {
        padding: 16px;
    }
}

/* Selector y vista previa de fotografías */
.campo-fotografias {
    margin-top: 18px;
}

.campo-fotografias input[type="file"] {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #fff;
    box-sizing: border-box;
}

.campo-fotografias small {
    display: block;
    margin-top: 8px;
    color: #666;
    line-height: 1.5;
}

.vista-previa-imagenes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.vista-previa-imagenes img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #ddd;
}

@media (max-width: 600px) {
    .vista-previa-imagenes {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


.campo-fotografias {
    grid-column: 1 / -1;
}

.campo-fotografias small {
    display: block;
    margin-top: 8px;
    line-height: 1.5;
}

.vista-previa-imagenes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.imagen-previa {
    min-width: 0;
}

.imagen-previa img {
    display: block;
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

.imagen-previa small {
    display: block;
    overflow-wrap: anywhere;
    font-size: 12px;
}

.acciones-formulario {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.acciones-formulario button {
    padding: 11px 16px;
    border: 0;
    border-radius: 6px;
    background: #e00000;
    color: white;
    font-weight: 600;
    cursor: pointer;
}

.acciones-formulario button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.acciones-formulario #btnCancelarEdicion {
    background: #555;
}

.btn-editar-vehiculo {
    padding: 9px 16px;
    border: 0;
    border-radius: 6px;
    background: #222;
    color: white;
    cursor: pointer;
}

.btn-editar-vehiculo:hover {
    background: #444;
}

[hidden] {
    display: none !important;
}

.foto-actual {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.foto-actual img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.btn-eliminar-foto {
    margin-top: 0;
    padding: 8px;
    border: 0;
    border-radius: 6px;
    background: #c62828;
    color: white;
    font-size: 13px;
    cursor: pointer;
}

.btn-eliminar-foto:hover {
    background: #991b1b;
}
.btn-eliminar-vehiculo {
    margin-left: 8px;
    padding: 9px 16px;
    border: 0;
    border-radius: 6px;
    background: #c62828;
    color: white;
    cursor: pointer;
}

.btn-eliminar-vehiculo:hover {
    background: #991b1b;
}

.btn-eliminar-vehiculo:disabled {
    opacity: 0.6;
    cursor: wait;
}
/* diseño popup */

/* Notificaciones discretas del panel administrativo */
.contenedor-notificaciones {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(360px, calc(100vw - 32px));
    pointer-events: none;
}

.notificacion {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 18px;
    background: #fff;
    color: #222;
    border: 1px solid #e5e5e5;
    border-left: 4px solid #198754;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.14);
    font-size: 14px;
    line-height: 1.45;
    opacity: 0;
    transform: translateX(15px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.notificacion.visible {
    opacity: 1;
    transform: translateX(0);
}

.notificacion-icono {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e7f5ec;
    color: #198754;
    font-weight: bold;
    font-size: 16px;
}

.notificacion-texto {
    flex: 1;
    overflow-wrap: anywhere;
}

.notificacion.error {
    border-left-color: #dc3545;
}

.notificacion.error .notificacion-icono {
    background: #fce8ea;
    color: #dc3545;
}

.notificacion.advertencia {
    border-left-color: #d99a00;
}

.notificacion.advertencia .notificacion-icono {
    background: #fff3cd;
    color: #946c00;
}

@media (max-width: 600px) {
    .contenedor-notificaciones {
        top: 12px;
        right: 12px;
        width: calc(100vw - 24px);
    }
}

/* diseño popup para eliminar vehiculo */

/* Modal de confirmación ADS Autos Deluxe */
.modal-confirmacion[hidden] {
    display: none !important;
}

.modal-confirmacion {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(3px);
}

.modal-confirmacion-contenido {
    width: 100%;
    max-width: 440px;
    padding: 30px;
    border-radius: 16px;
    background: #fff;
    color: #222;
    text-align: center;
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.25);
    animation: aparecerConfirmacion 0.2s ease-out;
}

.modal-confirmacion-icono {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: #fff1f0;
    color: #d71920;
    border: 2px solid #f4c7c5;
    font-size: 34px;
    font-weight: 700;
}

.modal-confirmacion-contenido h2 {
    margin: 0 0 12px;
    font-size: 23px;
    font-weight: 700;
}

.modal-confirmacion-contenido p {
    margin: 0;
    color: #666;
    font-size: 15px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.modal-confirmacion-acciones {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
}

.modal-confirmacion-acciones button {
    margin: 0;
    padding: 12px 17px;
    border: 0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

#btnCancelarConfirmacion {
    background: #f0f0f0;
    color: #333;
}

#btnCancelarConfirmacion:hover {
    background: #e1e1e1;
}

#btnAceptarConfirmacion {
    background: #d71920;
    color: #fff;
}

#btnAceptarConfirmacion:hover {
    background: #b51218;
    transform: translateY(-1px);
}

.modal-confirmacion-acciones button:focus-visible {
    outline: 3px solid #777;
    outline-offset: 3px;
}

@keyframes aparecerConfirmacion {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 480px) {
    .modal-confirmacion-contenido {
        padding: 24px 18px;
    }

    .modal-confirmacion-acciones {
        flex-direction: column-reverse;
    }

    .modal-confirmacion-acciones button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .modal-confirmacion-contenido {
        animation: none;
    }
}
