
/* ============================================================
   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;
    }
}

/* Consolidated final login alignment */
.login-wrap{
    min-height:calc(100vh - 72px);
    display:grid!important;
    grid-template-columns:repeat(2, minmax(0, 520px))!important;
    justify-content:center!important;
    align-items:center!important;
    gap:32px!important;
    padding:24px 26px 58px!important;
    max-width:none!important;
    margin:0 auto!important;
}

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

.login-copy{
    align-self:center!important;
}

.auth-side{
    width:100%;
    position:relative;
    display:block!important;
    align-self:center!important;
}

.auth-page-footer{
    position:absolute;
    left:0;
    right:0;
    top:calc(100% + 16px);
    margin:0!important;
    padding:0 8px;
}

.login-card{
    display:flex!important;
    flex-direction:column!important;
    justify-content:flex-start!important;
    padding:52px 30px 34px!important;
}

.login-card h2{
    margin:0 0 14px!important;
    min-height:42px!important;
    display:flex!important;
    align-items:flex-start!important;
    line-height:1.08!important;
}

.login-card .muted{
    margin:0 0 28px!important;
    min-height:28px!important;
    line-height:1.45!important;
    display:block!important;
}

.secure-form{
    margin-top:0!important;
    display:block!important;
}

.secure-field{
    margin-top:0!important;
}

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

.secure-form .btn,
.login-card .btn{
    margin-top:20px!important;
}

.fineprint{
    margin-top:18px!important;
    min-height:48px!important;
    line-height:1.55!important;
    display:block!important;
}

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

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

    .auth-side{
        position:relative;
    }

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

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

    .auth-page-footer{
        position:static;
        margin-top:16px!important;
    }

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

    .login-card h2,
    .login-card .muted,
    .fineprint{
        min-height:auto!important;
    }

    .login-card .muted{
        margin-bottom:22px!important;
    }
}

/* Strict parity between portal and gestion access screens */
@media(min-width:901px){
    body.ol-guest .login-wrap{
        grid-auto-rows:minmax(520px, auto)!important;
        align-items:stretch!important;
        align-content:center!important;
        justify-content:center!important;
        padding:24px 26px 72px!important;
    }

    body.ol-guest .login-copy,
    body.ol-guest .auth-side,
    body.ol-guest .login-card{
        min-height:520px!important;
        height:100%!important;
        align-self:stretch!important;
    }

    body.ol-guest .login-card{
        box-sizing:border-box;
    }
}

@media(min-width:1121px){
    body.ol-guest .login-wrap{
        grid-template-columns:repeat(2, minmax(0, 520px))!important;
        max-width:none!important;
    }
}

@media(min-width:901px) and (max-width:1120px){
    body.ol-guest .login-wrap{
        grid-template-columns:repeat(2, minmax(0, 1fr))!important;
        max-width:980px!important;
    }
}

/* Public review invitation */
.review-public-wrap{
    min-height:calc(100vh - 72px);
    display:grid;
    place-items:center;
    padding:34px 18px 54px;
}

.review-public-card{
    width:min(100%, 720px);
    border-radius:30px;
    border:1px solid var(--auth-line);
    background:rgba(255,253,248,.97);
    box-shadow:var(--auth-shadow);
    padding:34px;
}

body.dark .review-public-card{
    background:rgba(14,34,55,.97);
    border-color:rgba(255,255,255,.12);
}

.review-public-logo{
    width:220px;
    max-width:72%;
    height:auto;
    display:block;
    margin:0 auto 28px;
}

body.dark .review-public-logo{
    filter:brightness(0) invert(1);
}

.review-public-heading span,
.review-result-mark{
    display:inline-flex;
    margin-bottom:10px;
    color:var(--auth-gold);
    font-size:12px;
    font-weight:900;
    letter-spacing:.12em;
    text-transform:uppercase;
}

.review-public-heading h1,
.review-result-card h1{
    margin:0 0 10px;
    color:var(--auth-ink);
    font-size:34px;
    line-height:1.06;
    letter-spacing:0;
}

body.dark .review-public-heading h1,
body.dark .review-result-card h1{
    color:#fff;
}

.review-public-heading p,
.review-result-card p{
    margin:0 0 22px;
    color:var(--auth-muted);
    line-height:1.65;
}

.review-person-box{
    border:1px solid var(--auth-line);
    border-radius:18px;
    background:rgba(189,146,80,.08);
    padding:14px 16px;
    margin:18px 0 22px;
}

.review-person-box strong,
.review-person-box span{
    display:block;
}

.review-person-box span{
    margin-top:4px;
    color:var(--auth-muted);
    font-size:13px;
}

.review-public-name{
    color:var(--auth-ink);
    font-weight:900;
}

body.dark .review-public-name{
    color:#fff;
}

.review-form{
    display:grid;
    gap:14px;
}

.review-form textarea{
    min-height:132px;
    resize:vertical;
}

.review-counter{
    margin-top:-8px;
    color:var(--auth-green);
    font-size:13px;
    font-weight:800;
    text-align:right;
}

.review-counter.is-warn{
    color:#9a6a1f;
}

.review-counter.is-danger{
    color:var(--auth-red);
}

.review-avatar-field{
    display:grid;
    gap:12px;
    padding:18px;
    border:1px solid var(--auth-line);
    border-radius:20px;
    background:rgba(255,255,255,.46);
}

body.dark .review-avatar-field{
    background:rgba(255,255,255,.05);
}

.avatar-upload-row{
    display:flex;
    align-items:center;
    gap:12px;
    width:100%;
    min-height:46px;
    padding:6px;
    border:1px solid var(--auth-line);
    border-radius:14px;
    background:rgba(255,255,255,.68);
}

body.dark .avatar-upload-row{
    background:rgba(255,255,255,.06);
}

.avatar-file-input{
    position:absolute;
    width:1px;
    height:1px;
    overflow:hidden;
    clip:rect(0, 0, 0, 0);
    white-space:nowrap;
    clip-path:inset(50%);
}

.avatar-file-button{
    flex:0 0 auto;
    margin:0!important;
    border:1px solid rgba(189,146,80,.48);
    border-radius:11px;
    padding:9px 12px;
    background:rgba(189,146,80,.13);
    color:var(--auth-ink);
    font-size:13px;
    font-weight:900;
    line-height:1;
    cursor:pointer;
    transition:background .18s ease, border-color .18s ease, transform .18s ease;
}

.avatar-file-button:hover{
    background:rgba(189,146,80,.20);
    border-color:rgba(189,146,80,.72);
    transform:translateY(-1px);
}

body.dark .avatar-file-button{
    color:#fff;
}

.avatar-file-name{
    min-width:0;
    color:var(--auth-muted);
    font-size:13px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

body.dark .avatar-file-name{
    color:var(--auth-muted);
}

.avatar-editor{
    display:grid;
    gap:14px;
    justify-items:center;
    margin-top:4px;
    padding:18px;
    border:1px dashed rgba(189,146,80,.46);
    border-radius:18px;
    background:rgba(255,253,248,.72);
}

body.dark .avatar-editor{
    background:rgba(255,255,255,.04);
}

.avatar-editor[hidden]{
    display:none;
}

.avatar-editor-copy{
    display:grid;
    gap:4px;
    width:100%;
    text-align:center;
}

.avatar-editor-copy strong{
    color:var(--auth-ink);
    font-size:14px;
    font-weight:900;
}

body.dark .avatar-editor-copy strong{
    color:#fff;
}

.avatar-editor-copy span{
    color:var(--auth-muted);
    font-size:13px;
    line-height:1.45;
}

.avatar-editor-stage{
    display:grid;
    place-items:center;
    width:100%;
}

.avatar-editor-actions{
    display:flex;
    flex-wrap:wrap;
    justify-content:center;
    gap:10px;
    width:100%;
}

.avatar-editor-button{
    min-height:38px;
    border:1px solid rgba(189,146,80,.42);
    border-radius:12px;
    padding:0 13px;
    background:rgba(255,255,255,.70);
    color:var(--auth-ink);
    font-size:13px;
    font-weight:900;
    cursor:pointer;
    transition:background .18s ease, border-color .18s ease, transform .18s ease;
}

.avatar-editor-button:hover{
    background:rgba(189,146,80,.12);
    border-color:rgba(189,146,80,.72);
    transform:translateY(-1px);
}

.avatar-editor-button.danger{
    border-color:rgba(164,58,52,.28);
    color:var(--auth-red);
}

.avatar-editor-button.danger:hover{
    background:rgba(164,58,52,.08);
    border-color:rgba(164,58,52,.46);
}

body.dark .avatar-editor-button{
    background:rgba(255,255,255,.06);
    color:#fff;
}

body.dark .avatar-editor-button.danger{
    color:#ffb7b3;
}

.review-avatar-preview{
    width:178px;
    height:178px;
    border-radius:999px;
    overflow:hidden;
    display:grid;
    place-items:center;
    background:#fff;
    border:1px solid var(--auth-line);
    touch-action:none;
    user-select:none;
}

.review-avatar-preview img{
    width:100%;
    height:100%;
    object-fit:cover;
    object-position:50% 50%;
    transition:transform .14s ease;
    will-change:transform;
    pointer-events:none;
    user-select:none;
}

.review-avatar-preview.is-ready{
    cursor:grab;
    box-shadow:
        0 0 0 4px rgba(189,146,80,.10),
        0 16px 28px rgba(16,32,51,.10);
}

.review-avatar-preview.is-dragging{
    cursor:grabbing;
}

.review-avatar-preview.is-dragging img{
    transition:none;
}

.review-form .btn[disabled]{
    cursor:not-allowed;
    opacity:.48;
    transform:none;
    filter:saturate(.55);
}

.review-consent{
    margin-top:2px;
}

.review-form-actions{
    display:flex;
    align-items:center;
    gap:12px;
    flex-wrap:wrap;
}

.review-form-actions .btn{
    min-width:150px;
}

.review-clear-button{
    border-color:rgba(189,146,80,.32)!important;
    background:rgba(255,255,255,.64)!important;
    color:var(--auth-ink)!important;
}

body.dark .review-clear-button{
    background:rgba(255,255,255,.06)!important;
    color:#fff!important;
}

.review-submit-status{
    margin-top:2px;
    padding:12px 14px;
    border-radius:14px;
    border:1px solid rgba(47,118,87,.24);
    background:rgba(47,118,87,.08);
    color:var(--auth-green);
    font-size:13px;
    font-weight:800;
    line-height:1.45;
}

.review-submit-status[hidden]{
    display:none;
}

.review-submit-status.is-error{
    border-color:rgba(164,58,52,.24);
    background:rgba(164,58,52,.08);
    color:var(--auth-red);
}

.review-submit-status.is-ok{
    border-color:rgba(47,118,87,.26);
    background:rgba(47,118,87,.09);
    color:var(--auth-green);
}

.review-result-card{
    text-align:center;
}

.review-result-card .review-public-logo{
    margin-left:auto;
    margin-right:auto;
}

@media(max-width:640px){
    .review-public-card{
        padding:26px 20px;
        border-radius:26px;
    }

    .review-public-heading h1,
    .review-result-card h1{
        font-size:29px;
    }

    .avatar-upload-row{
        align-items:stretch;
        flex-direction:column;
    }

    .avatar-file-button{
        width:100%;
        text-align:center;
    }

    .avatar-file-name{
        white-space:normal;
    }

    .avatar-editor-actions{
        display:grid;
    }

    .avatar-editor{
        padding:16px 12px;
    }

    .review-avatar-preview{
        width:164px;
        height:164px;
    }

    .review-form-actions{
        display:grid;
    }

    .review-form-actions .btn{
        width:100%;
    }
}
