/* SIGPLUS Login - PrimeFaces 13
   Salvar em: src/main/webapp/resources/poseidon-layout/css/sigplus-login.css */

*, *::before, *::after {
    box-sizing: border-box;
}

html,
body.sigplus-login-body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
}

body.sigplus-login-body {
    min-height: 100vh !important;
    padding: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    overflow-x: hidden !important;
    background: #0f2f1f !important;
    font-family: "Segoe UI", Arial, sans-serif !important;
}

/* Fundo */
.sigplus-login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: #0f2f1f;
}

.sigplus-login-bg-image {
    width: 105%;
    height: 105%;
    object-fit: cover;
    display: block;
    opacity: .82;
    filter: blur(2px) saturate(.95);
    transform: scale(1.05);
    margin: -2.5%;
    transition: opacity .8s ease;
}

.sigplus-login-bg-overlay {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(circle at 18% 8%, rgba(255, 207, 74, .18), transparent 30%),
        linear-gradient(120deg, rgba(10, 43, 26, .58), rgba(8, 31, 20, .46)),
        rgba(0, 0, 0, .18);
}

/* Card principal */
.sigplus-login-card {
    position: relative;
    z-index: 1;
    width: min(1080px, 94vw);
    min-height: 620px;
    display: grid;
    grid-template-columns: 42% 58%;
    overflow: hidden;
    border-radius: 28px;
    background: #ffffff;
    box-shadow:
        0 28px 80px rgba(0, 0, 0, .34),
        0 10px 26px rgba(0, 0, 0, .22);
}

/* Painel esquerdo */
.sigplus-login-panel {
    min-width: 0;
    padding: 3rem 3rem 2.2rem;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at top left, rgba(35, 116, 84, .09), transparent 34%),
        #ffffff;
}

.sigplus-login-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 1.75rem;
}

.sigplus-login-logo {
    width: 220px;
    max-width: 100%;
    max-height: 80px;
    object-fit: contain;
    display: block;
}

.sigplus-login-copy {
    text-align: center;
    margin-bottom: 1.5rem;
}

.sigplus-login-copy h1 {
    margin: 0;
    color: #164828;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

.sigplus-login-copy p {
    margin: .45rem auto 0;
    max-width: 280px;
    color: #667085;
    font-size: .9rem;
    line-height: 1.45;
}

.login-form-area {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

form#login-wrapper,
#login-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    position: static !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.login-messages {
    margin-bottom: .85rem;
}

.login-field {
    width: 100%;
    min-height: 54px;
    margin-bottom: .95rem;
    padding: 6px 14px 6px 8px;
    display: flex;
    align-items: center;
    overflow: hidden;
    border-radius: 14px !important;
    background: #eef1ef;
    border: 1px solid rgba(22, 72, 40, .10);
    transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.login-field:focus-within {
    background: #ffffff;
    border-color: rgba(35, 116, 84, .62);
    box-shadow: 0 0 0 4px rgba(35, 116, 84, .14);
}

.field-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    margin-right: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(35, 116, 84, .08);
}

.login-field-image {
    width: 30px;
    height: 30px;
    object-fit: contain;
    display: block;
}

/* PrimeFaces 13 / temas Poseidon */
.login-field .ui-inputfield,
.login-field input,
.login-field .ui-password input,
.login-field .p-password input {
    width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    padding: 9px 0 !important;
    color: #344054 !important;
    font-size: .95rem !important;
    font-weight: 500 !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.login-field .ui-inputfield::placeholder,
.login-field input::placeholder {
    color: #7a8795;
    opacity: 1;
}

.login-field .ui-password,
.login-field .p-password {
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
}

.login-error-label {
    display: block;
    margin: -.25rem 0 .75rem;
    padding: .65rem .75rem;
    border-radius: 10px;
    background: #fff1f1;
    border-left: 4px solid #d92d20;
    color: #b42318;
    font-size: .82rem;
    line-height: 1.35;
}

.login-options {
    width: 100%;
    margin: .2rem 0 1.3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .9rem;
    font-size: .86rem;
}

.remember-label {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    color: #6b7280;
    white-space: nowrap;
}

.login-options a {
    color: #237454;
    font-size: .84rem;
    font-weight: 700;
    text-decoration: none;
}

.login-options a:hover,
.login-options a:focus {
    text-decoration: underline;
}

.login-btn-row {
    width: 100%;
}

.login-btn-row .ui-button,
.ui-button.btn-entrar {
    width: 100% !important;
    min-height: 52px !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 999px !important;
    background: linear-gradient(90deg, #1f6b3b 0%, #237454 100%) !important;
    color: #ffffff !important;
    font-size: .88rem !important;
    font-weight: 800 !important;
    letter-spacing: .12em !important;
    text-transform: uppercase !important;
    box-shadow: 0 11px 22px rgba(35, 116, 84, .28);
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

.login-btn-row .ui-button:hover,
.ui-button.btn-entrar:hover {
    filter: brightness(1.04);
    transform: translateY(-1px);
    box-shadow: 0 15px 28px rgba(35, 116, 84, .34);
}

.login-btn-row .ui-button .ui-button-text,
.ui-button.btn-entrar .ui-button-text {
    padding: 0 !important;
}

.sigplus-company-brand {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.sigplus-company-logo {
    width: 145px;
    max-width: 100%;
    max-height: 72px;
    object-fit: contain;
    display: block;
}

/* Painel direito */
.sigplus-login-visual {
    position: relative;
    min-height: 620px;
    overflow: hidden;
    background: #164828;
}

.sigplus-login-visual-image {
    width: 100%;
    height: 100%;
    min-height: 620px;
    display: block;
    object-fit: cover;
    transition: opacity .8s ease;
}

.sigplus-login-visual-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, .04), rgba(0, 0, 0, .58)),
        linear-gradient(120deg, rgba(22, 72, 40, .58), rgba(255, 207, 74, .08));
}

.sigplus-login-visual-content {
    position: absolute;
    left: 2.2rem;
    right: 2.2rem;
    bottom: 2.2rem;
    max-width: 470px;
    padding: 1.35rem 1.45rem;
    border-radius: 20px;
    background: rgba(8, 39, 24, .42);
    border: 1px solid rgba(255, 255, 255, .18);
    color: #ffffff;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.sigplus-login-kicker {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    color: #ffcf4a;
    font-size: .77rem;
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.sigplus-login-kicker::before {
    content: "";
    width: 32px;
    height: 3px;
    border-radius: 999px;
    background: #ffcf4a;
}

.sigplus-login-visual-content h2 {
    margin: .65rem 0 .45rem;
    font-size: 1.65rem;
    line-height: 1.12;
    font-weight: 800;
}

.sigplus-login-visual-content p {
    margin: 0;
    color: rgba(255, 255, 255, .9);
    font-size: .96rem;
    line-height: 1.5;
}

/* Modal */
.reset-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, .58);
}

.reset-overlay.active {
    display: flex;
}

.reset-modal {
    position: relative;
    width: min(390px, 94vw);
    padding: 2.35rem 2rem 2rem;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 22px 64px rgba(0, 0, 0, .38);
    animation: modalIn .18s ease;
}

@keyframes modalIn {
    from {
        transform: translateY(-16px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.reset-modal-close {
    position: absolute;
    top: .85rem;
    right: 1rem;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: #f2f4f7;
    color: #667085;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}

.reset-modal-close:hover {
    background: #e8ecef;
    color: #344054;
}

.reset-modal-logo {
    text-align: center;
    margin-bottom: 1rem;
}

.reset-modal-logo-img {
    width: 150px;
    max-width: 100%;
    object-fit: contain;
}

.reset-modal-title {
    margin-bottom: .35rem;
    text-align: center;
    color: #164828;
    font-size: 1.08rem;
    font-weight: 800;
}

.reset-modal-sub {
    margin-bottom: 1.35rem;
    text-align: center;
    color: #667085;
    font-size: .84rem;
    line-height: 1.5;
}

.reset-modal-field {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding: 7px 14px 7px 12px;
    border-radius: 12px;
    background: #eef1ef;
    border: 1px solid rgba(22, 72, 40, .10);
}

.reset-modal-field input {
    width: 100%;
    flex: 1;
    padding: 8px 0;
    border: none;
    outline: none;
    background: transparent;
    color: #344054;
    font-size: .92rem;
}

.reset-modal-field-icon {
    margin-right: 10px;
    color: #237454;
    font-size: 1rem;
}

.reset-modal-error,
.reset-modal-success {
    display: none;
    margin-bottom: 1rem;
    padding: .75rem .9rem;
    border-radius: 10px;
    font-size: .83rem;
    line-height: 1.45;
}

.reset-modal-error.visible,
.reset-modal-success.visible {
    display: block;
}

.reset-modal-error {
    background: #fff1f1;
    border-left: 4px solid #d92d20;
    color: #b42318;
}

.reset-modal-success {
    background: #f0f7f3;
    border-left: 4px solid #237454;
    color: #1f6b3b;
}

.reset-modal-btn {
    width: 100%;
    min-height: 48px;
    border: none;
    border-radius: 999px;
    background: #237454;
    color: #ffffff;
    cursor: pointer;
    font-size: .84rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    transition: background .18s ease, transform .18s ease;
}

.reset-modal-btn:hover {
    background: #1f6b3b;
    transform: translateY(-1px);
}

.reset-modal-btn:disabled {
    background: #98a2b3;
    cursor: not-allowed;
    transform: none;
}

/* Responsivo */
@media (max-width: 920px) {
    body.sigplus-login-body {
        padding: 16px !important;
    }

    .sigplus-login-card {
        width: min(520px, 94vw);
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .sigplus-login-panel {
        padding: 2.25rem 1.8rem 1.8rem;
    }

    .sigplus-login-visual {
        display: none;
    }
}

@media (max-width: 480px) {
    .sigplus-login-panel {
        padding: 1.9rem 1.25rem 1.5rem;
    }

    .sigplus-login-logo {
        width: 190px;
    }

    .sigplus-login-copy h1 {
        font-size: 1.28rem;
    }

    .login-options {
        align-items: flex-start;
        flex-direction: column;
        gap: .75rem;
    }

    .field-icon {
        width: 38px;
        height: 38px;
        min-width: 38px;
    }

    .login-field-image {
        width: 27px;
        height: 27px;
    }
    .login-auth-message {
    display: flex;
    align-items: flex-start;
    gap: .65rem;

    width: 100%;
    margin: 0 0 1rem;
    padding: .8rem .9rem;

    border: 1px solid transparent;
    border-radius: 9px;

    font-size: .84rem;
    line-height: 1.4;
	}

	.login-auth-message-icon {
	    flex: 0 0 auto;
	    padding-top: .05rem;
	    font-size: 1rem;
	}
	
	.login-auth-message-text {
	    flex: 1;
	}
	
	.login-auth-message-error {
	    color: #9b1c1c;
	    background: #fff1f1;
	    border-color: #f4c7c7;
	}
	
	.login-auth-message-warning {
	    color: #825600;
	    background: #fff8e5;
	    border-color: #ead291;
	}
	
	.login-auth-message-success {
	    color: #166534;
	    background: #ecfdf5;
	    border-color: #86efac;
	}

	.login-auth-message-blocked {
	    color: #8a1520;
	    background: #fdecef;
	    border-color: #e9a8af;
	    font-weight: 600;
	}
}

@media (prefers-reduced-motion: reduce) {
    .sigplus-login-bg-image,
    .sigplus-login-visual-image,
    .login-btn-row .ui-button,
    .reset-modal-btn {
        transition: none !important;
    }

    .reset-modal {
        animation: none;
    }
}
