@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@500;600;700&display=swap');

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: #f5f5f7;
    color: #222;
}

h1,
h2,
.subtitulo,
button,
.boton-copiar,
.boton-icono {
    font-family: 'Poppins', sans-serif;
}

.pagina {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

h1,
h2,
.subtitulo,
button,
.boton-copiar,
.boton-icono {
    font-family: 'Poppins', sans-serif;
}

h1 {
    margin-bottom: 8px;
    font-weight: bold;
    color: #4A3678;
}

.subtitulo {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 18px;
    color: #564376;
    font-weight: bold;
}

.descripcion {
    margin-top: 0;
    color: #555;
}

.descripcion-movil {
    display: none;
}

.descripcion-escritorio {
    display: block;
}

.contenedor-traductor {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 24px;
}

.columna {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    overflow: hidden;
}

.cabecera-caja {
    padding: 12px 16px;
    border-bottom: 1px solid #ddd;
    background: #fafafa;
}

.cabecera-caja h2 {
    margin: 0;
    font-size: 18px;
    }

.caja-texto {
    min-height: 300px;
    padding: 18px;
    font-size: 17px;
    line-height: 1.6;
    outline: none;
    white-space: pre-wrap;
}

.caja-original {
    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.caja-original.caja-bloqueada {
    background-color: #EEEAF5;
    color: #666;
    cursor: not-allowed;
}

.caja-original:empty::before {
    content: attr(data-placeholder);
    color: #999;
}

.caja-resultado .placeholder {
    color: #999;
}

.acciones {
    display: flex;
    gap: 12px;
    margin-top: 18px;
}

button {
    border: none;
    border-radius: 8px;
    padding: 12px 18px;
    font-size: 15px;
    cursor: pointer;
    background: #564376;
    color: #fff;
    font-weight: bold;
}

button:hover {
    opacity: 0.92;
}

.boton-secundario {
    background: #666;
}

.estado {
    margin-top: 14px;
    color: #555;
}

.panel-explicaciones {
    margin-top: 24px;
}

.panel-explicaciones h2 {
    margin-bottom: 14px;
}

/* Cabecera del apartado de explicaciones */
.cabecera-explicaciones {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.cabecera-explicaciones h2 {
    margin: 0;
}

.boton-informe-cambios {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 36px;
    min-width: 36px;
    height: 36px;

    padding: 0;

    border: 1px solid #d8c9ea;
    border-radius: 8px;

    background: #fff;
    color: #564376;

    cursor: pointer;
}

.boton-informe-cambios:hover {
    background: #EEEAF5;
    color: #4A3678;
    border-color: #4A3678;
    opacity: 1;
}

.boton-informe-cambios svg {
    display: block;

    fill: none;
    stroke: currentColor;

    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tarjeta-explicacion {
    background: #fff;
    border: 1px solid #ddd;
    border-left: 6px solid #564376;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 12px;
}

.tarjeta-explicacion p {
    margin: 6px 0;
}

.fragmento-original {
    color: #c1121f;
    font-weight: bold;
}

.fragmento-sustituido {
    color: #218838;
    font-weight: bold;
}

.autores {
    color: #4A3678;
    font-weight: bold;
    background-color: #f1e6ff;
    padding: 2px 5px;
    border-radius: 4px;
}

.pie-pagina {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    font-size: 14px;
    color: #666;
    text-align: center;
}

.pie-pagina p {
    margin: 4px 0;
}

.label-selector-alternativa {
    display: block;
    margin-top: 10px;
    margin-bottom: 6px;
}

.selector-alternativa-traductor {
    display: block;
    width: 100%;
    padding: 8px;
    margin-bottom: 8px;
    border: 1px solid #cfc6df;
    border-radius: 6px;
    background-color: #fff;
    color: #222;
    font-size: 15px;
}

.selector-alternativa-traductor:focus {
    outline: 2px solid #4A3678;
    border-color: #4A3678;
}

.opcion-recomendada {
    font-weight: bold;
    color: #4A3678;
}

.nota-recomendada {
    font-size: 13px;
    color: #4A3678;
    margin-top: 4px;
    margin-bottom: 10px;
}

.detalle-alternativa {
    margin-top: 10px;
    padding: 10px;
    background-color: #faf7ff;
    border-radius: 6px;
}

/* Ajustes generales responsive */
html {
    font-size: 16px;
}

body {
    overflow-x: hidden;
}

.pagina {
    width: 100%;
}

.contenedor-traductor {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.columna {
    min-width: 0;
}

.caja-texto {
    overflow-wrap: break-word;
    word-break: normal;
    overflow-y: auto;
}

.selector-alternativa-traductor {
    max-width: 100%;
}

.cabecera-caja-resultado {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.boton-copiar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #d8c9ea;
    border-radius: 8px;
    padding: 7px 10px;
    background: #fff;
    color: #564376;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

.boton-copiar:hover {
    background: #f4ecff;
    opacity: 1;
}

.boton-copiar svg {
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.boton-copiar.oculto {
    display: none;
}

.boton-copiar.copiado {
    background: #e6f4ea;
    color: #218838;
    border-color: #b8dfc2;
}

.oculto {
    display: none !important;
}

.cabecera-caja-original,
.cabecera-caja-resultado {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.boton-icono {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    min-width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #d8c9ea;
    border-radius: 8px;
    background: #fff;
    color: #564376;
    cursor: pointer;
}

.boton-icono:hover {
    background: #f4ecff;
    opacity: 1;
}

.boton-icono svg {
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}

button:disabled,
.boton-icono:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

button:disabled:hover,
.boton-icono:disabled:hover {
    opacity: 0.55;
}

.estado-cargando {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #564376;
    font-weight: bold;
}

.spinner-analisis {
    width: 18px;
    height: 18px;
    border: 3px solid #d8c9ea;
    border-top-color: #564376;
    border-radius: 50%;
    animation: girar-spinner 0.8s linear infinite;
}

@keyframes girar-spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Cabecera principal de la aplicación */
.cabecera-aplicacion {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;

    margin-bottom: 18px;

    overflow: visible;
}

/* Botón de cierre de sesión */

.boton-logout {
    flex: 0 0 auto;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 38px;
    height: 38px;

    border: 1px solid #d8c9ea;
    border-radius: 8px;

    background: #fff;
    color: #564376;

    text-decoration: none;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.boton-logout:hover {
    background: #F8EAF0;
    color: #C94F7C;
    border-color: #C94F7C;

    box-shadow:
        0 4px 12px
        rgba(201, 79, 124, 0.14);
}

.boton-logout svg {
    display: block;

    fill: none;
    stroke: currentColor;

    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.logo-principal {
    display: block;
    width: auto;
    height: 65px;
    max-width: 100%;
    max-width: none;
    object-fit: contain;
    margin-left: -7px;
}

/* Selector principal de modos */
.selector-modos {
    margin-top: 18px;
    border-bottom: 1px solid #ddd;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

.tabs-modos {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    min-width: max-content;
}

/* Sobrescribe el estilo general de los botones */
.tab-modo {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: auto;
    min-width: max-content;

    padding: 11px 16px 12px;

    border: none;
    border-radius: 8px 8px 0 0;

    background: transparent;
    color: #666;

    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.tab-modo.activo {
    transform: translateY(-1px);
}

.tab-modo:hover {
    background: #fff;
    color: #564376;
    opacity: 1;
}

.tab-modo.activo {
    background: #fff;
    color: #564376;

    border: 1px solid #cfc0e6;
    border-bottom-color: transparent;

    box-shadow: 0 3px 10px rgba(86, 67, 118, 0.14);

    font-weight: 700;
}

.tab-modo.activo::after {
    content: "";
    position: absolute;

    left: 10px;
    right: 10px;
    bottom: -1px;

    height: 4px;

    border-radius: 4px 4px 0 0;
    background: #C94F7C;
}

.tab-modo:focus-visible {
    outline: 3px solid #d8c9ea;
    outline-offset: 2px;
}

/* Contenido asociado a cada pestaña */
.panel-modo {
    padding-top: 18px;
}

.panel-modo[hidden] {
    display: none !important;
}

/* Panel temporal para funcionalidades futuras */
.panel-proximamente {
    padding: 28px;
    border: 1px solid #ddd;
    border-radius: 12px;
    background: #fff;
}

.panel-proximamente h2 {
    margin-top: 0;
    margin-bottom: 8px;
    color: #564376;
}

.panel-proximamente p {
    margin: 0;
    color: #555;
    line-height: 1.6;
}

/* =========================================================
   Pantalla de acceso administrativo
   ========================================================= */

.pagina-login {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;

    background:
        radial-gradient(
            circle at top left,
            rgba(201, 79, 124, 0.08),
            transparent 34%
        ),
        radial-gradient(
            circle at bottom right,
            rgba(74, 54, 120, 0.10),
            transparent 38%
        ),
        #f5f5f7;
}

.contenedor-login {
    width: 100%;
    max-width: 460px;
}

.tarjeta-login {
    position: relative;

    width: 100%;

    padding: 42px 38px 34px;

    border: 1px solid #ddd;
    border-radius: 16px;

    background: #fff;

    box-shadow:
        0 18px 45px
        rgba(74, 54, 120, 0.12);
}

.logo-login {
    display: block;

    width: min(100%, 300px);

    margin:
        0 auto
        28px;
}

.cabecera-login {
    margin-bottom: 26px;

    text-align: center;
}

.cabecera-login h1 {
    margin:
        0
        0
        8px;

    color: #4A3678;

    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    line-height: 1.25;
}

.cabecera-login p {
    margin: 0;

    color: #666;

    font-size: 15px;
    line-height: 1.55;
}


/* Botón volver */

.volver-login {
    position: absolute;

    top: 16px;
    left: 16px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 36px;
    height: 36px;

    border: 1px solid #d8c9ea;
    border-radius: 8px;

    background: #fff;
    color: #564376;

    text-decoration: none;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

.volver-login:hover {
    background: #EEEAF5;
    color: #4A3678;
    border-color: #4A3678;
}

.volver-login svg {
    fill: none;
    stroke: currentColor;

    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* Formulario */

.formulario-login {
    display: flex;
    flex-direction: column;

    gap: 18px;
}

.grupo-campo-login {
    display: flex;
    flex-direction: column;

    gap: 7px;
}

.grupo-campo-login label {
    color: #333;

    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
}

.campo-login-con-icono {
    position: relative;
}

.campo-login-con-icono svg {
    position: absolute;

    top: 50%;
    left: 14px;

    transform: translateY(-50%);

    fill: none;
    stroke: #777;

    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;

    pointer-events: none;
}

.campo-login-con-icono input {
    width: 100%;

    padding:
        13px
        14px
        13px
        44px;

    border: 1px solid #d7d3dc;
    border-radius: 8px;

    background: #fff;
    color: #222;

    font-family: 'Inter', sans-serif;
    font-size: 16px;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

.campo-login-con-icono input:hover {
    border-color: #b9aec9;
}

.campo-login-con-icono input:focus {
    border-color: #4A3678;

    box-shadow:
        0 0 0 3px
        rgba(74, 54, 120, 0.12);

    background: #FAF7FF;
}

.campo-login-con-icono:focus-within svg {
    stroke: #4A3678;
}


/* Botón acceder */

.boton-acceso-login {
    width: 100%;

    margin-top: 4px;

    padding: 13px 18px;

    border: none;
    border-radius: 8px;

    background: #564376;
    color: #fff;

    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        transform 0.15s ease,
        box-shadow 0.2s ease;
}

.boton-acceso-login:hover {
    background: #4A3678;

    box-shadow:
        0 7px 18px
        rgba(74, 54, 120, 0.20);

    opacity: 1;
}

.boton-acceso-login:active {
    transform: translateY(1px);
}


/* Error */

.mensaje-error-login {
    display: flex;
    align-items: flex-start;

    gap: 9px;

    margin-bottom: 20px;
    padding: 11px 13px;

    border: 1px solid #e7b5c7;
    border-radius: 8px;

    background: #F8EAF0;
    color: #8e3155;

    font-size: 14px;
    line-height: 1.45;
}

.mensaje-error-login svg {
    flex: 0 0 auto;

    margin-top: 1px;

    fill: none;
    stroke: currentColor;

    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* Pie */

.pie-login {
    margin:
        24px
        0
        0;

    color: #888;

    text-align: center;

    font-size: 12px;
}

/* Tablets y pantallas medianas */
@media (max-width: 900px) {
    .pagina {
        padding: 24px 16px;
    }

    .cabecera-aplicacion {
        margin-bottom: 16px;
    }

    .logo-principal {
        height: 58px;
        margin-left: -6px;
    }

    .contenedor-traductor {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .caja-texto {
        min-height: 240px;
        font-size: 17px;
    }

    .descripcion-escritorio {
        display: none;
    }

    .descripcion-movil {
        display: block;
    }
}

/* Móviles */
@media (max-width: 600px) {
    .pagina {
        padding: 20px 12px;
    }

    .cabecera-aplicacion {
        justify-content: flex-start;
        margin-bottom: 12px;
    }

    .logo-principal {
        height: 44px;
        margin-left: -5px;
    }

    h1 {
        font-size: 32px;
        line-height: 1.1;
        margin-bottom: 10px;
    }

    .subtitulo {
        font-size: 17px;
        line-height: 1.35;
    }

    .descripcion {
        font-size: 15px;
        line-height: 1.45;
    }

    .contenedor-traductor {
        margin-top: 18px;
        gap: 14px;
    }

    .cabecera-caja {
        padding: 10px 12px;
    }

    .cabecera-caja h2 {
        font-size: 17px;
    }

    .caja-texto {
        min-height: 220px;
        padding: 14px;
        font-size: 16px;
        line-height: 1.55;
    }

    .acciones {
        flex-direction: column;
        gap: 10px;
    }

    button {
        width: 100%;
        padding: 14px 18px;
        font-size: 16px;
    }

    .estado {
        font-size: 15px;
    }

    .panel-explicaciones {
        margin-top: 20px;
    }

    .panel-explicaciones h2 {
        font-size: 20px;
    }

    .tarjeta-explicacion {
        padding: 12px;
        border-left-width: 4px;
    }

    .tarjeta-explicacion p {
        font-size: 15px;
        line-height: 1.45;
    }

    .selector-alternativa-traductor {
        font-size: 16px;
        padding: 10px;
    }

    .detalle-alternativa {
        padding: 10px;
    }

    .pie-pagina {
        margin-top: 28px;
        padding: 18px 12px 24px;
        font-size: 13px;
        line-height: 1.45;
    }

    .autores {
        display: inline-block;
        margin-top: 4px;
    }

    .cabecera-caja-resultado {
        align-items: flex-start;
    }

    .boton-copiar {
        padding: 7px 9px;
        font-size: 13px;
    }

    .texto-copiar {
        display: none;
    }

    .boton-icono,
    .boton-copiar {
        width: 36px;
        min-width: 36px;
        height: 36px;
        padding: 0;
    }

    .cabecera-caja-original,
    .cabecera-caja-resultado {
        align-items: center;
    }
	
	.caja-original:empty,
    .caja-resultado:has(.placeholder) {
        min-height: 130px;
    }

    .selector-modos {
        margin-top: 14px;
    }

    .tabs-modos {
        gap: 2px;
    }

    .tabs-modos .tab-modo {
        width: auto;
        min-width: max-content;
        flex: 0 0 auto;

        padding: 10px 13px 11px;

        font-size: 14px;
    }

    .tab-modo.activo::after {
        left: 10px;
        right: 10px;
    }

    .panel-modo {
        padding-top: 14px;
    }

    .panel-proximamente {
        padding: 20px 16px;
    }

    .cabecera-explicaciones {
        align-items: center;
        gap: 10px;
    }

    .cabecera-explicaciones h2 {
        flex: 1;
    }

    .cabecera-explicaciones .boton-informe-cambios {
        width: auto;
        min-width: auto;

        padding: 9px 11px;

        font-size: 13px;
    }

    .cabecera-explicaciones .boton-informe-cambios span {
        display: none;
    }

    .pagina-login {
        padding: 16px;
    }

    .tarjeta-login {
        padding:
            38px
            22px
            28px;
    }

    .logo-login {
        width: min(100%, 250px);

        margin-bottom: 24px;
    }

    .cabecera-login h1 {
        font-size: 21px;
    }

    .cabecera-login p {
        font-size: 14px;
    }

    .volver-login {
        top: 12px;
        left: 12px;
    }

    .boton-logout {
        width: 36px;
        height: 36px;
    }

    .boton-logout svg {
        width: 19px;
        height: 19px;
    }
}

/* Móviles muy estrechos */
@media (max-width: 380px) {
    h1 {
        font-size: 28px;
    }

    .subtitulo {
        font-size: 16px;
    }

    .logo-principal {
        width: min(100%, 285px);
    }

    .caja-texto {
        min-height: 200px;
        font-size: 16px;
    }

    .tarjeta-explicacion p {
        font-size: 14px;
    }
	
	.caja-original:empty,
    .caja-resultado:has(.placeholder) {
        min-height: 115px;
    }
}