*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: #f3f4f6;
    color: #111827;
}

:root {
    --gl-green: #066a4f;
    --gl-green-dark: #04523d;
    --gl-green-soft: #e6f3ee;
    --gl-border-soft: #e5e7eb;
    --gl-text-main: #111827;
    --gl-text-soft: #6b7280;
}

.gl-login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.gl-login-layout {
    width: 100%;
    max-width: 1120px;
    min-height: 520px;
    display: flex;
    border-radius: 18px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.04);
}

/* Lado esquerdo – institucional */

.gl-login-left {
    flex: 3;
    background: var(--gl-green);
    color: #f9fafb;
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.gl-left-header {
    font-size: 13px;
    letter-spacing: .12em;
    text-transform: uppercase;
    opacity: 0.88;
}

.gl-left-mark {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(249, 250, 251, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.gl-left-main {
    margin-top: 40px;
    max-width: 420px;
}

.gl-left-logo-wrapper {
    margin-bottom: 64px;
}

.gl-left-logo {
    height: 32px;
    width: auto;
    display: block;
}

.gl-left-title-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 18px;
}

.gl-left-eyebrow {
    font-size: 12px;
    letter-spacing: .18em;
    text-transform: uppercase;
    opacity: 0.9;
}

.gl-left-byline {
    font-size: 13px;
    opacity: 0.85;
}

.gl-left-headline {
    font-size: 28px;
    line-height: 1.25;
    font-weight: 650;
    margin: 0 0 16px;
}

.gl-left-headline,
.gl-form-title {
    font-family: 'Raleway', sans-serif;
}

.gl-left-subcopy {
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.9;
}

.gl-left-footer {
    font-size: 12px;
    opacity: 0.8;
}

.gl-left-powered {
    padding-top: 4px;
}

/* Lado direito – formulário */

.gl-login-right {
    flex: 2;
    background: #ffffff;
    padding: 32px 40px;
    display: flex;
    flex-direction: column;
}

.gl-right-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 24px;
}

.gl-lang-switch {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    border: 1px solid var(--gl-border-soft);
    background: #f9fafb;
}

.gl-lang-switch button {
    border: none;
    background: transparent;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    color: var(--gl-text-soft);
    transition: background-color .15s ease, color .15s ease;
}

.gl-lang-switch button.is-active {
    background: #ffffff;
    color: var(--gl-text-main);
    font-weight: 600;
}

.gl-form-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.gl-form-title {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 6px;
}

.gl-form-subtitle {
    font-size: 13px;
    color: var(--gl-text-soft);
    margin: 0 0 24px;
}

.gl-error {
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 18px;
    font-size: 13px;
    background: #fef2f2;
    color: #bc0000;
    border: 1px solid #fecaca;
}

.gl-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.gl-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gl-field label {
    font-size: 13px;
    color: var(--gl-text-main);
}

.gl-field input {
    width: 100%;
    padding: 11px 12px;
    border-radius: 8px;
    border: 1px solid var(--gl-border-soft);
    font-size: 14px;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
    background-color: #ffffff;
}

.gl-field input:focus {
    outline: none;
    border-color: var(--gl-green);
    box-shadow: 0 0 0 1px rgba(0, 102, 51, 0.25);
    background-color: #ffffff;
}

.gl-password-wrapper {
    display: flex;
    align-items: center;
    border-radius: 8px;
    border: 1px solid var(--gl-border-soft);
    background: #ffffff;
    padding-right: 4px;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.gl-password-wrapper:focus-within {
    border-color: var(--gl-green);
    box-shadow: 0 0 0 1px rgba(0, 102, 51, 0.25);
}

.gl-password-wrapper input {
    border: none;
    box-shadow: none;
}

.gl-password-toggle {
    border: none;
    background: transparent;
    padding: 4px 8px;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.gl-password-toggle-icon {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 1px solid var(--gl-border-soft);
    position: relative;
}

.gl-password-toggle-icon::before,
.gl-password-toggle-icon::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 999px;
    border: 1px solid var(--gl-border-soft);
}

.gl-password-toggle.is-active .gl-password-toggle-icon {
    border-color: var(--gl-green);
}

.gl-btn {
    margin-top: 2px;
    width: 100%;
    padding: 11px 14px;
    border-radius: 999px;
    border: none;
    background: var(--gl-green);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color .15s ease, transform .1s ease, box-shadow .15s ease;
}

.gl-btn:hover {
    background: var(--gl-green-dark);
    box-shadow: 0 6px 14px rgba(0, 102, 51, 0.28);
    transform: translateY(-1px);
}

.gl-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 9px rgba(0, 102, 51, 0.2);
}

.gl-btn.is-loading {
    cursor: default;
    opacity: 0.9;
    box-shadow: none;
}

.gl-btn.is-loading .gl-btn-label {
    opacity: 0.9;
}

.gl-btn.is-loading::after {
    content: "";
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.65);
    border-top-color: transparent;
    animation: gl-spin 0.6s linear infinite;
}

.gl-microcopy {
    margin-top: 12px;
    font-size: 12px;
    color: var(--gl-text-soft);
}

/* Animações */

.gl-fade-in {
    opacity: 0;
    transform: translateY(12px);
    animation: gl-fade-in-up .45s ease-out forwards;
}

@keyframes gl-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gl-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsivo */

@media (max-width: 900px) {
    .gl-login-layout {
        flex-direction: column;
        max-width: 480px;
    }

    .gl-login-left {
        padding: 32px 24px 28px;
    }

    .gl-login-right {
        padding: 24px 20px 28px;
    }

    .gl-left-headline {
        font-size: 24px;
    }
}

@media (max-width: 600px) {
    .gl-login-shell {
        padding: 16px;
    }

    .gl-login-layout {
        border-radius: 16px;
    }
}

/* Overrides de paleta oficial Solução Lusa */
:root {
    --gl-green: #006633;
    --gl-green-dark: #004d26;
    --gl-green-soft: #e6f2ec;
    --gl-red: #bc0000;
    --gl-gold: #d4af37;
    --gl-dark: #2f2f2f;
    --gl-border-soft: #e5e7eb;
    --gl-text-main: #111827;
    --gl-text-soft: #6b7280;
}
