/* login.css (responsive + fixes iOS) */

/* ---------- Reset / tipografía ---------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    height: -webkit-fill-available; /* iOS fix */
    background: #ffffff;
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    color: #222;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden; /* iOS scroll horizontal fix */
}

/* Reduce animaciones para usuarios que lo pidan */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* ---------- Header ---------- */
header {
    background: #EB0028;
    color: #fff;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 20;
    -webkit-backdrop-filter: blur(0); /* iOS sticky fix */
    backdrop-filter: blur(0);
}

    header img {
        height: 48px;
        width: auto;
    }

    header strong {
        font-weight: 700;
        font-size: 14px;
        letter-spacing: .06em;
    }

@media (max-width: 480px) {
    header {
        padding: 12px 10px;
    }

        header img {
            height: 44px;
        }
}

/* ---------- Contenedor principal ---------- */
.login-container {
    width: 100%;
    max-width: 520px;
    margin: 48px auto 120px;
    padding: 0 18px;
    display: block;
    /* iOS keyboard-safe area */
    min-height: calc(100vh - 80px);
    min-height: calc(100dvh - 80px); /* navegadores modernos */
}

@media (min-width: 1200px) {
    .login-container {
        max-width: 560px;
        margin-top: 64px;
    }
}

@media (max-height: 680px) and (max-width: 640px) {
    html, body {
        height: 100%;
    }

    body {
        display: flex;
        align-items: center;
    }

    .login-container {
        margin: 0 auto;
        padding-top: 6vh;
        padding-bottom: 6vh;
    }
}

/* ---------- Título ---------- */
.login-title {
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: #111;
    margin-bottom: 18px;
    letter-spacing: .04em;
}

/* ---------- Mensajes ---------- */
.response-message {
    margin-bottom: 12px;
    text-align: center;
    font-weight: 600;
    color: #e80c2f;
}

/* ---------- Formulario y campos ---------- */
form {
    width: 100%;
}

    form > div {
        margin-bottom: 16px;
    }

/* Inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="date"] {
    width: 100%;
    padding: 12px 14px;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.06);
    background: #eaf3ff;
    font-size: 16px !important; /* iOS: evita zoom automático */
    outline: none;
    transition: box-shadow .14s, transform .06s, border-color .12s;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
    -webkit-appearance: none;
}

/* Placeholder */
input::placeholder {
    color: #8fa6c8;
}

/* Focus accesible */
input:focus {
    box-shadow: 0 0 0 4px rgba(201,45,42,0.06);
    transform: translateY(-1px);
    border-color: rgba(201,45,42,0.20);
}

/* Autocompletado */
input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #eaf3ff inset !important;
    -webkit-text-fill-color: #111 !important;
}

/* ---------- Enlace 'Olvidaste tu contraseña' ---------- */
.forgot-password {
    display: block;
    text-align: center;
    font-size: 13px;
    color: #1b9c7a;
    text-decoration: none;
    margin-top: -6px;
    margin-bottom: 8px;
}

/* ---------- reCAPTCHA ---------- */
.g-recaptcha, .chatbot {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 6px 0 18px;
}

    .g-recaptcha > div {
        max-width: 100%;
    }

/* ---------- Botones ---------- */
button[type="submit"] {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(#c92d2a, #b92220);
    border: none;
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 3px 0 rgba(0,0,0,0.06);
    transition: transform .06s ease, box-shadow .06s ease, opacity .12s;
    min-height: 44px; /* iOS touch size */
}

    button[type="submit"]:hover {
        transform: translateY(-2px);
    }

    button[type="submit"]:active {
        transform: translateY(0);
    }

.center-registrate {
    display: block;
    margin: 12px auto 0;
    width: 100%;
    text-align: center;
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid rgba(201,45,42,0.25);
    color: #c92d2a;
    text-decoration: none;
    font-weight: 600;
    background: transparent;
    min-height: 44px; /* iOS touch size */
}

button + .center-registrate {
    margin-top: 12px;
}

/* ---------- Pie ---------- */
.footer-contact {
    font-size: 12px;
    color: #8b8b8b;
    text-align: center;
    margin-top: 28px;
    padding: 8px 12px;
}

/* ---------- Accesibilidad ---------- */
:focus {
    outline: 3px solid rgba(0, 136, 204, 0.08);
    outline-offset: 2px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .login-container {
        margin: 36px auto 90px;
        padding: 0 20px;
    }

    header img {
        height: 46px;
    }
}

@media (max-width: 768px) {
    .login-container {
        max-width: 460px;
        margin: 28px auto 60px;
        padding: 0 18px;
    }

    .login-title {
        font-size: 13px;
    }

    button[type="submit"] {
        padding: 12px;
        font-size: 15px;
    }

    .forgot-password {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    header img {
        height: 40px;
    }

    header strong {
        font-size: 13px;
        display: none;
    }

    .login-container {
        max-width: 100%;
        margin: 14px 12px 48px;
        padding: 8px;
    }

    .login-title {
        font-size: 13px;
        margin-bottom: 12px;
    }

    form > div {
        margin-bottom: 12px;
    }

    .g-recaptcha, .chatbot {
        margin: 8px 0 14px;
    }

    .center-registrate {
        padding: 10px;
        font-size: 14px;
    }

    .footer-contact {
        font-size: 11px;
        padding: 6px 8px;
        margin-top: 22px;
    }
}

@media (max-width: 360px) {
    .login-container {
        margin-left: 8px;
        margin-right: 8px;
    }
}
