*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
    padding: 20px;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, #1e3a5f, #2563eb);
    padding: 40px 40px 30px;
    text-align: center;
}

.login-header img {
    width: 160px;
    height: auto;
    display: block;
    margin: 0 auto 16px;
    border-radius: 8px;
}

.login-header h2 {
    color: #ffffff;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.login-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    margin-top: 4px;
}

.login-body {
    padding: 36px 40px 40px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 15px;
    pointer-events: none;
    transition: color 0.2s;
}

.input-wrapper:focus-within i {
    color: #2563eb;
}

.form-control {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 42px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: #1e293b;
    background: #f8fafc;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    outline: none;
}

.form-control:focus {
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.form-control::placeholder {
    color: #cbd5e1;
}

.form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.remember-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
    cursor: pointer;
    user-select: none;
}

.remember-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #2563eb;
    cursor: pointer;
}

.forgot-link {
    font-size: 13px;
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.forgot-link:hover {
    text-decoration: underline;
}

.btn-login {
    width: 100%;
    height: 50px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
}

.btn-login:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.btn-login:active {
    transform: translateY(0);
}

.error-message {
    margin-top: 16px;
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
    font-size: 13px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-footer {
    text-align: center;
    padding: 14px 24px;
    border-top: 1px solid #e2e8f0;
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.5;
}

@media (max-width: 480px) {
    body {
        padding: 16px;
        align-items: flex-start;
        padding-top: 32px;
    }

    .login-header {
        padding: 28px 24px 22px;
    }

    .login-header img {
        width: 120px;
    }

    .login-header h2 {
        font-size: 18px;
    }

    .login-body {
        padding: 24px 24px 28px;
    }

    .form-control {
        font-size: 16px; /* previene zoom automático en iOS */
        height: 50px;
    }

    .form-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .btn-login {
        height: 52px;
        font-size: 16px;
    }
}

@media (max-width: 360px) {
    body {
        padding: 12px;
        padding-top: 24px;
    }
}

/* ===== App de ECFNube (acuerdo 110) ===== */

/* «Descargar la app» bajo la tarjeta de la entrada: discreto, sobre el fondo oscuro. */
.app-enlace-entrada {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}

.app-enlace {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 18px;
    border: 1.5px solid rgba(174, 205, 232, 0.45);
    border-radius: 999px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.app-enlace:hover,
.app-enlace:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    border-color: #00b4d8;
    outline: none;
}

.app-enlace .fa-android {
    color: #3ddc84;
    font-size: 18px;
}

.app-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: #fff3e0;
    color: #8a3c00;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
    line-height: 1.5;
    vertical-align: middle;
}

/* Dentro de la app (html.ecf-app, lo marca la app) nunca se muestra. */
html.ecf-app [data-ecf-app-boton] {
    display: none !important;
}

/* Página descargar_app.php */
.app-descarga-caja {
    max-width: 480px;
}

.login-header .app-descarga-icono {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.app-boton {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    line-height: 1;
}

.app-boton .fa-android {
    font-size: 20px;
}

.app-boton-pronto,
.app-boton-pronto:hover {
    background: #e2e8f0;
    color: #475569;
    box-shadow: none;
    cursor: default;
    transform: none;
    opacity: 1;
}

.app-nota {
    margin-top: 12px;
    font-size: 13px;
    line-height: 1.5;
    color: #64748b;
    text-align: center;
}

.app-sin-corte {
    white-space: nowrap;
}

.app-nota-izq {
    text-align: left;
    display: flex;
    gap: 8px;
}

.app-nota-izq i {
    margin-top: 3px;
    color: #2563eb;
}

.app-aviso {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: 10px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-size: 14px;
    line-height: 1.5;
}

.app-aviso i {
    margin-top: 3px;
    font-size: 16px;
    color: #2563eb;
}

.app-aviso-ok {
    background: #e8f5e9;
    border-color: #a5d6a7;
}

.app-aviso-ok i {
    color: #2e7d32;
}

.app-qr {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-top: 22px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.app-qr img {
    flex: none;
    border-radius: 6px;
    background: #ffffff;
}

.app-qr div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: #475569;
    line-height: 1.45;
}

.app-qr strong {
    color: #1e293b;
    font-size: 14px;
}

.app-qr code {
    font-size: 12.5px;
    color: #1e3a5f;
    word-break: break-all;
}

.app-titulo {
    margin: 26px 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.app-pasos {
    padding-left: 22px;
    color: #334155;
    font-size: 14px;
    line-height: 1.55;
}

.app-pasos li {
    margin-bottom: 8px;
    padding-left: 2px;
}

.app-pasos li::marker {
    color: #2563eb;
    font-weight: 700;
}

.app-volver {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    margin-top: 10px;
    color: #2563eb;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.app-volver:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
    .app-qr {
        flex-direction: column;
        text-align: center;
    }
}

/* Pantalla táctil (acuerdo 110): enlaces y «Recordarme» con 40 px para el dedo, sin mover el diseño */
@media (pointer: coarse) {
    .forgot-link { display: inline-flex; align-items: center; min-height: 40px; }
    .remember-label { min-height: 40px; }
    .remember-label input[type="checkbox"] { width: 20px; height: 20px; }
}
