/* ============================================================
   recuperarcontrasena.css – versión final optimizada con fixes iOS + responsive
   ============================================================ */

/* ---------- Reset global ---------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    height: -webkit-fill-available; /* iOS fix */
    background: #fff;
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, Arial;
    color: #222;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Header ---------- */
header {
    background: #EB0028;
    color: #fff;
    padding: 18px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 20;
    /* iOS sticky fix */
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

    header img {
        height: 48px;
        width: auto;
    }

/* ---------- Contenedor centrado ---------- */
.login-container {
    width: 100%;
    max-width: 520px;
    margin: 36px auto 120px;
    padding: 0 22px;
    text-align: center;
    /* iOS keyboard-safe height */
    min-height: calc(100vh - 80px);
    min-height: calc(100dvh - 80px);
}

/* ---------- Centrado vertical en móvil ---------- */
@media (max-width: 640px) {
    body {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .login-container {
        margin: 0 auto;
        padding-top: 4vh;
        padding-bottom: 6vh;
        max-width: 96%;
    }
}

/* ---------- Título ---------- */
.login-title {
    font-size: 18px;
    font-weight: 700;
    color: #111;
    margin-bottom: 16px;
}

/* ---------- Animación mensajes ---------- */
@keyframes slideFadeIn {
    0% {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }

    60% {
        opacity: 1;
        transform: translateY(0) scale(1.02);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ---------- Mensajes dinámicos ---------- */
.response-message {
    display: inline-block;
    background: #fff5f5;
    border: 1px solid #e8bebe;
    color: #8a1f1f;
    padding: 6px 12px;
    border-radius: 3px;
    font-size: 13px;
    margin-bottom: 18px;
    animation: slideFadeIn 360ms cubic-bezier(.2,.9,.3,1) both;
    box-shadow: 0 6px 18px rgba(0,0,0,0.04);
    opacity: 1;
    transition: opacity 1s ease;
}

.response-success {
    background: #f2fff5;
    border-color: #b7e7c0;
    color: #176d2e;
}

.response-error {
    background: #fff5f5;
    border-color: #e8bebe;
    color: #8a1f1f;
}

.response-message.fade-out {
    opacity: 0;
}

/* ---------- Formulario ---------- */
form {
    width: 100%;
}

    form > div {
        margin-bottom: 18px;
        text-align: left;
    }

label {
    display: block;
    font-size: 13px;
    color: #444;
    margin-bottom: 8px;
}

/* ---------- Inputs con underline ---------- */
input[type="text"],
input[type="email"] {
    width: 100%;
    padding: 8px 6px 10px;
    border: none;
    border-bottom: 1px solid #cfcfcf;
    background: transparent;
    /* evita zoom automático de iOS */
    font-size: 16px !important;
    outline: none;
    transition: border-color .15s, box-shadow .12s;
}

input::placeholder {
    color: #bdbdbd;
}

input:focus {
    border-bottom-color: #e1403f;
    box-shadow: 0 2px 0 rgba(225,64,63,0.04);
}

/* iOS autofill fix */
input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px white inset !important;
    -webkit-text-fill-color: #111 !important;
}

/* ---------- Botón principal ---------- */
button[type="submit"] {
    display: block;
    width: 100%;
    padding: 12px 16px;
    margin-top: 6px;
    background: linear-gradient(#c92d2a, #b92220);
    color: #fff;
    border: none;
    font-weight: 600;
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 2px 0 rgba(0,0,0,0.06);
    transition: transform .06s ease, box-shadow .12s ease;
    /* tamaño táctil mínimo en móvil */
    min-height: 44px;
}

    button[type="submit"]:hover {
        transform: translateY(-1px);
    }

/* ---------- Botón secundario ---------- */
.center-registrate {
    display: block;
    width: 100%;
    padding: 10px 12px;
    text-align: center;
    margin-top: 12px;
    border-radius: 6px;
    border: 1px solid rgba(201,45,42,0.22);
    color: #c92d2a;
    background: transparent;
    text-decoration: none;
    font-weight: 600;
    min-height: 44px;
}

/* ---------- Footer ---------- */
.footer-contact {
    font-size: 12px;
    color: #8b8b8b;
    text-align: center;
    margin-top: 48px;
    padding: 8px 12px;
}

/* ---------- Responsivo ---------- */
@media (max-width: 640px) {
    header img {
        height: 44px;
    }

    .response-message {
        font-size: 12.5px;
        padding: 6px 10px;
    }

    button[type="submit"] {
        font-size: 15px;
    }

    .center-registrate {
        font-size: 14px;
    }

    .footer-contact {
        font-size: 11px;
        margin-top: 30px;
    }
}
