* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
    height: 100%;
    font-family: 'Segoe UI', Arial, sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
main {
    flex: 1;
}
.cabecera {
    flex-shrink: 0;
}
.footer {
    flex-shrink: 0;
}

.pantalla {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background: url('../assets/fondoinicio.png') center/cover no-repeat;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.contenido {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4vh 4vw;
}

.logo {
    width: min(620px, 80vw);
    max-width: 100%;
    margin-bottom: 5vh;
}

.form {
    width: min(360px, 80vw);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.form input {
    width: 100%;
    padding: 13px 22px;
    border: 1px solid #cfd6dd;
    border-radius: 30px;
    background: rgba(255,255,255,0.92);
    font-size: 15px;
    color: #555;
    outline: none;
}
.form input::placeholder { color: #9aa3ab; }
.form input:focus { box-shadow: 0 0 0 2px rgba(255,255,255,0.6); }

.btn-login {
    border: none;
    background: transparent;
    cursor: pointer;
    width: 220px;
    margin-top: 4px;
    transition: transform .15s ease;
}
.btn-login img { width: 100%; display: block; }
.btn-login:hover { transform: translateY(-1px); }
.btn-login:active { transform: translateY(1px); }
.btn-login:disabled { opacity: .6; cursor: default; transform: none; }

.mensaje {
    min-height: 18px;
    font-size: 13px;
    color: #fff;
    text-align: center;
    background: rgba(0,0,0,0.25);
    border-radius: 14px;
    padding: 0 14px;
    transition: padding .15s ease;
}
.mensaje:not(:empty) { padding: 7px 14px; }
.mensaje.error { background: rgba(176,16,16,0.55); }
.mensaje.ok { background: rgba(20,120,40,0.55); }

.footer {
    position: relative;
    z-index: 2;
    width: 100%;
    background: url('../assets/footer.png') bottom/100% auto no-repeat;
    min-height: 150px;
}

.footer-texto {
    position: absolute;
    bottom: 12px;
    left: 55%;
    transform: translateX(-5%);
    text-align: center;
    color: #fff;
    font-size: 11px;
    line-height: 1.5;
    white-space: nowrap;
}
.footer-texto strong { font-weight: 700; }

.footer-derecha {
    position: absolute;
    bottom: 10px;
    right: 18px;
    color: #fff;
    font-size: 11px;
    text-align: right;
    line-height: 1.4;
}
.footer-derecha {
    position: absolute;
    bottom: 12px;
    right: 22px;
    color: #fff;
    font-size: 10px;
    text-align: right;
    line-height: 1.5;
}
.footer-derecha a { color: #fff; text-decoration: none; }

@media (max-width: 900px) {
    .footer-texto {
        left: 50%;
        white-space: normal;
        width: 80%;
    }
}

.carga-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 40, 70, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease;
}
.carga-overlay.activo {
    opacity: 1;
    visibility: visible;
}
.carga-rueda {
    width: 90px;
    height: 90px;
    animation: girar 0.9s linear infinite;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.35));
}
@keyframes girar {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@media (max-width: 600px) {
    .footer-derecha { position: static; text-align: center; margin-top: 6px; }
    .footer-texto {
        position: static;
        left: auto;
        transform: none;
        width: 100%;
        padding: 14px 12px 6px;
    }
    .footer { background-size: cover; }
}
