/* Pantallas sin sesión (templates/global/base_acceso.html): login, código MFA, registros,
   «olvidé mi contraseña», términos, política y errores. Fondo, logo, caja blanca, campos, botón y
   pie, una sola vez; los nombres de clase son los del login. */

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

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #0a1929 0%, #122c43 50%, #1a4063 100%);
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ---- Caja centrada con el logo encima (todas menos el login) ---- */
.acceso-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 30px 20px;
}

/* El PNG del logo es cuadrado con mucho margen transparente arriba y abajo: se enseña solo la
   franja del centro, como en la cabecera (templates/global/header.html) */
.acceso-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 64px;
    overflow: hidden;
}

.acceso-logo img {
    width: 220px;
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
}

.login-box {
    background: white;
    border-radius: 16px;
    padding: 30px 30px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Formulario de dos columnas (registro público) */
.login-box.ancha {
    max-width: 800px;
}

/* Algo más ancha: el alta con Google, que enseña el correo de la cuenta */
.login-box.mediana {
    max-width: 500px;
}

/* Texto largo (términos y política) */
.login-box.texto {
    max-width: 900px;
    padding: 2.5rem;
}

.login-header {
    text-align: center;
    margin-bottom: 20px;
}

.login-header h2 {
    color: #122c43;
    font-weight: 700;
    font-size: 1.6rem;
    margin-bottom: 6px;
}

.login-header p {
    color: #666;
    font-size: 0.85rem;
}

/* Icono redondo encima del título */
.acceso-icono {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: white;
    font-size: 1.8rem;
}

.acceso-icono.verde {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.3);
}

.acceso-icono.rojo {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    box-shadow: 0 8px 20px rgba(220, 53, 69, 0.3);
}

.acceso-icono.azul {
    background: linear-gradient(135deg, #12b5ff 0%, #0d9dd9 100%);
    box-shadow: 0 8px 20px rgba(18, 181, 255, 0.3);
}

/* Dato destacado bajo el título (el correo al que llegó el código) */
.acceso-chip {
    display: inline-block;
    margin-top: 12px;
    background: #f0f7ff;
    color: #122c43;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.acceso-chip i {
    color: #12b5ff;
    margin-right: 6px;
}

/* ---- Campos ---- */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    color: #122c43;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.form-control {
    height: 44px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    transition: all 0.3s ease;
}

textarea.form-control {
    height: auto;
    min-height: 80px;
}

.form-control:focus {
    border-color: #12b5ff;
    box-shadow: 0 0 0 3px rgba(18, 181, 255, 0.1);
}

.login-box small.text-muted {
    font-size: 0.8rem;
}

.acceso-nota {
    color: #666;
    font-size: 0.8rem;
    margin-bottom: 4px;
}

/* Código de 6 cifras del MFA */
.acceso-codigo {
    width: 100%;
    height: 56px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 24px;
    text-align: center;
    letter-spacing: 8px;
    font-weight: 600;
    color: #122c43;
    transition: all 0.3s ease;
}

.acceso-codigo:focus {
    border-color: #12b5ff;
    box-shadow: 0 0 0 3px rgba(18, 181, 255, 0.1);
    outline: none;
}

.acceso-codigo.is-invalid {
    border-color: #dc3545;
}

/* Aviso en vivo bajo el nombre de usuario del registro (static/global/acceso.js) */
.acceso-usuario-aviso {
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.acceso-usuario-aviso.ok {
    color: #28a745;
}

.acceso-usuario-aviso.mal {
    color: #dc3545;
}

/* Casillas de aceptar política y términos */
.form-check {
    padding-left: 1.75rem;
    margin-bottom: 1rem;
}

.form-check-input {
    width: 18px;
    height: 18px;
    margin-top: 0.15rem;
    margin-left: -1.75rem;
    cursor: pointer;
}

.form-group .form-check-label {
    color: #333;
    font-size: 0.9rem;
    font-weight: 400;
    cursor: pointer;
}

.form-check-label a {
    color: #12b5ff;
    text-decoration: none;
    font-weight: 600;
}

.form-check-label a:hover {
    color: #0d9dd9;
    text-decoration: underline;
}

/* ---- Botones y enlaces ---- */
.btn-login {
    width: 100%;
    height: 44px;
    background: linear-gradient(135deg, #12b5ff 0%, #0d9dd9 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.3s ease;
    margin-top: 8px;
}

a.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Botón a la medida de su texto (al pie de términos y política) */
.btn-login.auto {
    display: inline-flex;
    width: auto;
    padding: 0 32px;
}

.btn-login:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(18, 181, 255, 0.4);
}

.btn-login:disabled:hover {
    transform: none;
    box-shadow: none;
}

.btn-google {
    width: 100%;
    height: 44px;
    background: white;
    color: #444;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-google:hover {
    background: #f8f9fa;
    border-color: #12b5ff;
    color: #122c43;
    text-decoration: none;
}

.link-password {
    display: block;
    text-align: center;
    margin-top: 14px;
    color: #122c43;
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.3s ease;
}

.link-password:hover {
    color: #12b5ff;
}

/* Botón con aspecto de enlace (reenviar el código del MFA) */
.acceso-btn-enlace {
    color: #12b5ff;
    font-weight: 600;
    font-size: 0.9rem;
    background: none;
    border: none;
    cursor: pointer;
}

.acceso-btn-enlace:hover {
    color: #0d9dd9;
    text-decoration: underline;
}

.acceso-reenviar {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #eee;
    text-align: center;
}

.acceso-reenviar p {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 6px;
}

/* Separador con texto en medio */
.divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: #999;
    font-size: 0.8rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

.divider::before {
    margin-right: 12px;
}

.divider::after {
    margin-left: 12px;
}

.divider.corto {
    margin: 15px 0;
}

/* ---- Avisos ---- */
.alert {
    border-radius: 10px;
    border: none;
    margin: 12px 0;
    font-size: 0.85rem;
    padding: 10px 12px;
}

.acceso-errores {
    list-style: none;
    margin: 0;
    padding: 0;
}

.acceso-errores li + li {
    margin-top: 4px;
}

.acceso-aviso-legal {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: #6c757d;
}

.acceso-aviso-legal a {
    color: #12b5ff;
    text-decoration: none;
}

/* Cuenta de Google con la que se completa el registro */
.acceso-google {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.acceso-google img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.acceso-google-texto {
    flex: 1;
    min-width: 0;
}

.acceso-google-texto .nombre {
    font-weight: 600;
    color: #122c43;
    font-size: 0.95rem;
}

.acceso-google-texto .correo {
    color: #666;
    font-size: 0.85rem;
    overflow-wrap: break-word;
}

.acceso-google-marca {
    background: #4285f4;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* ---- Texto largo: términos y política ---- */
.documento-titulo {
    margin-bottom: 30px;
    border-bottom: 3px solid #122c43;
    padding-bottom: 20px;
}

.documento-titulo h3 {
    color: #122c43;
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
}

.login-box.texto h2,
.login-box.texto h4 {
    color: #122c43;
    font-weight: 700;
}

.login-box.texto h2 {
    font-size: 1.4rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.login-box.texto h4 {
    font-size: 1.1rem;
    margin-top: 1rem;
    margin-bottom: 0.75rem;
}

.login-box.texto p,
.login-box.texto ul {
    color: #333;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.login-box.texto ul {
    padding-left: 1.5rem;
}

.login-box.texto strong {
    color: #122c43;
}

.login-box.texto a:not(.btn-login) {
    color: #12b5ff;
    text-decoration: none;
}

.login-box.texto a:not(.btn-login):hover {
    color: #0d9dd9;
    text-decoration: underline;
}

/* ---- Login: dos columnas, con el logo y lo que es UroData a la izquierda ---- */
.top-bar {
    padding: 10px 30px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.btn-sitio {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 6px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-sitio:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
}

.login-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 20px;
    overflow: hidden;
}

.login-wrapper {
    width: 100%;
    max-width: 1200px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.left-side {
    color: white;
    display: flex;
    flex-direction: column;
    padding: 0 40px;
    margin-top: -90px;
}

.logo-container img {
    width: 100%;
    max-width: 300px;
    height: auto;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
}

.info-text {
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.95;
    margin-bottom: 20px;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.feature-item i {
    color: #12b5ff;
    font-size: 20px;
    min-width: 24px;
}

.feature-item span {
    font-size: 0.9rem;
}

/* Sociedades que respaldan UroData, bajo la lista de ventajas como en la portada */
.aliados {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
}

.aliados-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

.logos-aliados {
    display: flex;
    align-items: center;
    gap: 18px;
}

.logo-aliado {
    max-height: 90px;
    width: auto;
    /* Igual que en la portada: entran con un pequeño salto, uno tras otro, y luego flotan */
    animation: aliadoEntra 0.7s 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both,
               aliadoFlota 5s 1s ease-in-out infinite;
}

.logo-aliado:nth-child(2) {
    animation-delay: 0.5s, 1.7s;
}

@keyframes aliadoEntra {
    from { opacity: 0; transform: scale(0.6) rotate(-8deg); }
    to { opacity: 1; transform: none; }
}

@keyframes aliadoFlota {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -6px; }
}

@media (prefers-reduced-motion: reduce) {
    .logo-aliado {
        animation: none;
    }
}

.right-side {
    display: flex;
    justify-content: center;
    padding: 0;
}

.register-section {
    text-align: center;
}

.btn-register {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 24px;
    background: white;
    color: #122c43;
    border: 2px solid #122c43;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.btn-register:hover {
    background: #122c43;
    color: white;
    text-decoration: none;
}

/* ---- Registro público: dos columnas como el login; a la izquierda, lo que se gana ---- */
.registro-arriba {
    justify-content: flex-start;
    padding: 18px 30px 0;
}

/* El PNG del logo lleva mucho margen transparente arriba y abajo: solo la franja del centro (.acceso-logo) */
.registro-logo {
    display: flex;
    align-items: center;
    height: 44px;
    overflow: hidden;
}

.registro-logo img {
    width: 150px;
    height: auto;
}

.registro .login-wrapper {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    align-items: center;
}

.registro .left-side {
    margin-top: 0;
}

.registro-titulo {
    margin: 0 0 1.25rem;
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: white;
}

.registro-titulo span {
    display: block;
    margin-top: 0.6rem;
    color: #5bd6f5;
}

.registro-texto {
    max-width: 26rem;
    margin: 0 0 1rem;
    font-size: 1.05rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.78);
}

.registro-texto--fuerte {
    color: white;
}

.registro .login-header {
    text-align: left;
}

/* Contraseña con su ojo para verla (udAccesoVerClave, static/global/acceso.js) */
.acceso-clave {
    position: relative;
}

.acceso-clave .form-control {
    padding-right: 42px;
}

/* Edge pone su propio ojo en las contraseñas: donde va el nuestro, se quita el suyo (los demás navegadores
   no lo tienen y no leen esta regla) */
.acceso-clave input::-ms-reveal {
    display: none;
}

.acceso-ver-clave {
    position: absolute;
    top: 0;
    right: 0;
    width: 42px;
    height: 44px;
    border: 0;
    background: none;
    color: #8a97a6;
    cursor: pointer;
}

.acceso-ver-clave:hover,
.acceso-ver-clave:focus {
    color: #12b5ff;
    outline: none;
}

/* Comentario plegado: «Añadir un comentario (opcional)» lo abre */
.registro-comentario {
    margin: 2px 0 14px;
}

.registro-comentario summary {
    list-style: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: #0d9dd9;
}

.registro-comentario summary::-webkit-details-marker {
    display: none;
}

.registro-comentario summary::before {
    content: '▸';
    display: inline-block;
    margin-right: 6px;
    transition: transform 0.2s ease;
}

.registro-comentario[open] summary::before {
    transform: rotate(90deg);
}

.registro-comentario .form-control {
    margin-top: 8px;
}

.registro-revision {
    margin: 10px 0 0;
    font-size: 0.78rem;
    text-align: center;
    color: #666;
}

.registro-entrar {
    margin: 14px 0 0;
    font-size: 0.85rem;
    text-align: center;
    color: #122c43;
}

.registro-entrar a {
    font-weight: 700;
    color: #0d9dd9;
}

/* Hasta 991 px, la caja debajo del texto (a dos columnas no cabe el formulario) */
@media (max-width: 991px) {
    .registro .login-wrapper {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }
    .registro .left-side {
        margin-top: 0;
        padding: 0 10px;
        text-align: center;
    }
    .registro-titulo {
        font-size: 2rem;
    }
    .registro-titulo span {
        display: inline;
    }
    .registro-texto {
        margin-left: auto;
        margin-right: auto;
    }
}

/* ---- Pie ---- */
footer {
    background: rgba(0, 0, 0, 0.2);
    color: white;
    padding: 12px;
    text-align: center;
    font-size: 0.75rem;
}

footer p {
    margin: 3px 0;
}

footer .pie-derechos {
    margin-top: 5px;
    opacity: 0.8;
}

footer a {
    color: white;
    text-decoration: none;
    margin: 0 6px;
}

footer a:hover {
    color: #12b5ff;
}

/* ---- Estrecha ---- */
@media (max-width: 768px) {
    .login-box.texto {
        padding: 1.5rem;
    }

    .documento-titulo h3 {
        font-size: 1.5rem;
    }

    .login-box.texto h2 {
        font-size: 1.2rem;
    }

    .login-box.texto h4 {
        font-size: 1rem;
    }
}

@media (max-width: 756px) {
    .login-wrapper {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .left-side {
        text-align: center;
        padding: 0 20px;
        margin-top: -60px;
    }

    .logo-container img {
        max-width: 200px;
    }

    .features-list {
        align-items: center;
    }

    .aliados {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .top-bar {
        padding: 8px 15px;
    }

    .logo-aliado {
        max-height: 60px;
    }

    .login-box {
        padding: 25px 20px;
    }

    .logo-container img {
        max-width: 220px;
    }

    .acceso-logo img {
        width: 180px;
    }
}
