
/* ============================================================
   OrtaLegal · Auth Visual v0.5
   Ajuste login: footer fuera de tarjeta, botones controlados,
   tarjetas iguales y textos refinados.
   ============================================================ */

:root{
    --auth-navy:#0b2845;
    --auth-navy-2:#12395d;
    --auth-gold:#bd9250;
    --auth-gold-2:#d7bd7c;
    --auth-cream:#f8f4ee;
    --auth-paper:#fffdf8;
    --auth-ink:#0e2035;
    --auth-muted:#718093;
    --auth-line:#e9ddcf;
    --auth-red:#a43a34;
    --auth-red-soft:#fff0ed;
    --auth-green:#2f7657;
    --auth-shadow:0 18px 46px rgba(16,32,51,.10);
    --auth-soft-shadow:0 10px 24px rgba(16,32,51,.06);
}

input:invalid{box-shadow:none}

/* Cabecera común */
.topbar{
    min-height:72px;
    height:72px;
    padding:0 28px;
    background:rgba(255,253,248,.94);
    border-bottom:1px solid var(--auth-line);
}

body.dark .topbar{
    background:rgba(8,26,45,.94);
}

.brand{
    gap:14px;
}

.brand-logo-header{
    width:48px;
    height:48px;
    object-fit:contain;
    display:block;
    flex:0 0 48px;
}

body.dark .brand-logo-header{
    filter:brightness(0) invert(1);
    opacity:.92;
}

.brand-wording strong{
    color:var(--auth-navy);
    font-size:15px;
    font-weight:850;
}

body.dark .brand-wording strong{
    color:#fff;
}

.brand-wording small{
    color:var(--auth-muted);
    font-size:12.5px;
}

/* Login común: dos piezas iguales */
.login-wrap{
    min-height:calc(100vh - 72px);
    display:grid!important;
    grid-template-columns:repeat(2, minmax(0, 520px))!important;
    justify-content:center;
    align-items:start!important;
    gap:32px!important;
    padding:58px 26px 34px!important;
    max-width:none!important;
    margin:0 auto!important;
}

.auth-side{
    width:100%;
    display:flex;
    flex-direction:column;
    align-items:stretch;
}

.login-copy,
.login-card{
    width:100%;
    min-height:520px;
}

.login-copy{
    border-radius:30px;
    background:
        radial-gradient(circle at 92% 0%,rgba(215,189,124,.16),transparent 19rem),
        linear-gradient(135deg,#0b2845 0%,#12395d 100%)!important;
    box-shadow:var(--auth-shadow);
    border:1px solid rgba(255,255,255,.11);
    padding:54px 48px 46px!important;
    display:flex!important;
    flex-direction:column;
    justify-content:center!important;
    overflow:hidden;
}

.login-copy::before{
    display:none!important;
}

.login-copy::after{
    content:"";
    position:absolute;
    right:-80px;
    top:-88px;
    width:245px;
    height:245px;
    border-radius:50%;
    border:1px solid rgba(215,189,124,.38);
    opacity:.9;
}

.auth-hero-logo{
    width:min(300px,62%);
    max-height:190px;
    object-fit:contain;
    object-position:left center;
    display:block;
    margin:0 0 58px;
    filter:brightness(0) invert(1) drop-shadow(0 11px 18px rgba(0,0,0,.16));
}

.login-copy .badge,
.login-copy .auth-badge{
    display:none!important;
}

.login-copy h1{
    font-size:46px!important;
    line-height:1.02!important;
    letter-spacing:-.062em!important;
    margin:0 0 18px!important;
    max-width:620px;
    text-shadow:0 2px 0 rgba(0,0,0,.18);
    color:#fff;
}

.login-copy p{
    color:#ecf3f8!important;
    max-width:620px;
    font-size:17px!important;
    line-height:1.65!important;
    margin:0!important;
}

.login-card{
    border-radius:28px!important;
    border:1px solid var(--auth-line)!important;
    background:rgba(255,253,248,.96)!important;
    box-shadow:var(--auth-shadow)!important;
    padding:34px 30px!important;
    display:flex;
    flex-direction:column;
    justify-content:center;
}

body.dark .login-card{
    background:rgba(14,34,55,.96)!important;
    border-color:rgba(255,255,255,.12)!important;
}

.login-card h2{
    font-size:29px!important;
    line-height:1.08!important;
    letter-spacing:-.045em!important;
    margin:0 0 10px!important;
    color:var(--auth-ink);
}

body.dark .login-card h2{
    color:#fff;
}

.login-card .muted{
    color:var(--auth-muted);
    margin-bottom:18px;
}

/* Formularios seguros */
.secure-form{
    margin-top:18px;
}

.secure-field{
    margin-top:14px;
}

.secure-field label,
.login-card label{
    color:#5f6f82;
    font-size:12px;
    font-weight:850;
    letter-spacing:.01em;
    margin-bottom:7px;
}

body.dark .secure-field label,
body.dark .login-card label{
    color:#c8d5e3;
}

.secure-field input,
.login-card input{
    min-height:47px;
    border-radius:15px!important;
    border:1px solid var(--auth-line)!important;
    background:#fff!important;
    color:var(--auth-ink)!important;
    padding:12px 14px!important;
    outline:none!important;
    transition:border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

body.dark .secure-field input,
body.dark .login-card input{
    background:#eaf2ff!important;
    color:#07182a!important;
}

.secure-field input:focus,
.login-card input:focus{
    border-color:rgba(189,146,80,.75)!important;
    box-shadow:0 0 0 4px rgba(189,146,80,.16)!important;
}

.secure-field.has-error input{
    border-color:#c94a3d!important;
    box-shadow:0 0 0 4px rgba(201,74,61,.12)!important;
}

.field-error{
    display:none;
    margin-top:7px;
    color:var(--auth-red);
    font-size:12.5px;
    line-height:1.45;
    font-weight:650;
}

.secure-field.has-error .field-error{
    display:block;
}

/* Alertas normalizadas */
.auth-alert,
.notice.bad,
.notice.ok,
.notice.warn,
.notice.info{
    display:flex;
    align-items:flex-start;
    gap:10px;
    border-radius:16px;
    padding:12px 14px;
    margin:16px 0;
    border:1px solid transparent;
    line-height:1.5;
    font-size:14px;
    box-shadow:var(--auth-soft-shadow);
}

.auth-alert::before,
.notice.bad::before,
.notice.ok::before,
.notice.warn::before,
.notice.info::before{
    content:"";
    width:9px;
    height:9px;
    border-radius:50%;
    flex:0 0 9px;
    margin-top:6px;
}

.auth-alert.error,
.notice.bad{
    background:var(--auth-red-soft)!important;
    border-color:#efc5be!important;
    color:var(--auth-red)!important;
}

.auth-alert.error::before,
.notice.bad::before{
    background:var(--auth-red);
    box-shadow:0 0 0 4px rgba(164,58,52,.12);
}

.notice.ok{
    background:#edf7f1!important;
    border-color:#bddbc8!important;
    color:var(--auth-green)!important;
}

.notice.ok::before{
    background:var(--auth-green);
    box-shadow:0 0 0 4px rgba(47,118,87,.12);
}

.notice.warn{
    background:#fff7e6!important;
    border-color:#efd9a6!important;
    color:#8b631f!important;
}

.notice.warn::before{
    background:#bd9250;
    box-shadow:0 0 0 4px rgba(189,146,80,.14);
}

.notice.info{
    background:#eef5ff!important;
    border-color:#c9ddf6!important;
    color:#12395d!important;
}

.notice.info::before{
    background:#12395d;
    box-shadow:0 0 0 4px rgba(18,57,93,.12);
}

/* Botón */
.login-card .btn,
.secure-form .btn{
    width:100%;
    justify-content:center;
    margin-top:20px;
    min-height:48px;
    border-radius:15px;
    background:linear-gradient(135deg,var(--auth-gold),var(--auth-gold-2))!important;
    color:#0e2035!important;
    font-weight:900;
    border:1px solid rgba(189,146,80,.48);
    box-shadow:0 10px 24px rgba(189,146,80,.20);
    transition:.16s ease;
}

.login-card .btn:hover:not(:disabled),
.secure-form .btn:hover:not(:disabled){
    transform:translateY(-1px);
    box-shadow:0 14px 28px rgba(189,146,80,.26);
}

.login-card .btn:disabled,
.secure-form .btn:disabled{
    opacity:.48;
    cursor:not-allowed;
    filter:saturate(.65);
    box-shadow:none;
    transform:none;
}

/* Footer fuera de la caja */
.auth-page-footer{
    margin-top:16px;
    padding:0 8px;
    color:#607086;
    font-size:12px;
    line-height:1.55;
    text-align:center;
}

body.dark .auth-page-footer{
    color:#bdcbd9;
}

.auth-page-footer strong{
    color:var(--auth-ink);
    font-weight:850;
}

body.dark .auth-page-footer strong{
    color:#fff;
}

.fineprint{
    color:#607086!important;
    font-size:12px!important;
    line-height:1.55!important;
    margin-top:15px!important;
}

/* Compatibilidad: ocultar footer antiguo si quedase cacheado en alguna vista */
.auth-login-footer{
    display:none!important;
}

/* Pantalla no logueada */
body:not(.ol-logged) .topbar{
    box-shadow:none;
}

body:not(.ol-logged) .top-actions form{
    display:none;
}

/* Responsive */
@media(max-width:1120px){
    .login-wrap{
        grid-template-columns:repeat(2, minmax(0, 1fr))!important;
        max-width:980px!important;
    }

    .login-copy,
    .login-card{
        min-height:500px;
    }
}

@media(max-width:900px){
    .login-wrap{
        grid-template-columns:1fr!important;
        max-width:620px!important;
        padding:28px 18px 28px!important;
    }

    .login-copy,
    .login-card{
        min-height:auto;
    }

    .login-copy{
        min-height:390px;
        padding:38px 32px!important;
    }

    .auth-hero-logo{
        width:240px;
        margin-bottom:40px;
    }

    .login-copy h1{
        font-size:38px!important;
    }
}

@media(max-width:640px){
    .topbar{
        padding:10px 16px;
        min-height:68px;
        height:auto;
    }

    .brand-logo-header{
        width:42px;
        height:42px;
        flex-basis:42px;
    }

    .brand-wording strong{
        font-size:14px;
    }

    .brand-wording small{
        font-size:11.5px;
    }

    .pill{
        padding:8px 10px;
        font-size:13px;
    }

    .login-wrap{
        padding:22px 14px 22px!important;
    }

    .login-copy{
        min-height:330px;
        padding:30px 24px!important;
        border-radius:26px;
    }

    .auth-hero-logo{
        width:210px;
        margin-bottom:34px;
    }

    .login-copy h1{
        font-size:32px!important;
    }

    .login-card{
        padding:24px!important;
    }
}
