:root {
    --primary: #116b3a;
    --primary-dark: #0d542e;
    --primary-deep: #083d22;
    --primary-soft: #edf8f1;

    --background: #f4f7f5;
    --surface: #ffffff;
    --surface-soft: #f8faf9;

    --text: #17231c;
    --muted: #66736b;
    --border: #d9e2dc;

    --success-background: #edf9f1;
    --success-text: #116b3a;

    --error-background: #fef2f2;
    --error-text: #b42318;

    --shadow: 0 18px 50px rgba(10, 45, 27, 0.1);
}

/* =========================================================
   CONFIGURAÇÕES GERAIS
========================================================= */

* {
    box-sizing: border-box;
}

html {
    width: 100%;
    min-height: 100%;
    background: var(--background);
}

body {
    width: 100%;
    min-width: 320px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;

    background: var(--background);
    color: var(--text);

    font-family: "Montserrat", sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;

    overflow-x: hidden;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    border: 0;
}

[hidden] {
    display: none !important;
}

/* =========================================================
   ESTRUTURA PRINCIPAL
========================================================= */

.main-container {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;

    display: grid;
    grid-template-columns: minmax(420px, 1.05fr) minmax(460px, 0.95fr);
}

/* =========================================================
   PAINEL ESQUERDO
========================================================= */

.banner-side {
    position: relative;

    min-height: 100vh;
    min-height: 100dvh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 48px;

    overflow: hidden;

    background:
        linear-gradient(
            145deg,
            rgba(17, 107, 58, 0.98) 0%,
            rgba(8, 61, 34, 0.98) 100%
        );

    color: #ffffff;
}

.banner-side::before {
    content: "";

    position: absolute;
    inset: 0;

    background:
        radial-gradient(
            circle at 20% 20%,
            rgba(255, 255, 255, 0.09),
            transparent 32%
        ),
        radial-gradient(
            circle at 80% 85%,
            rgba(255, 255, 255, 0.05),
            transparent 28%
        );

    pointer-events: none;
}

#networkCanvas {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    z-index: 1;
}

.banner-content {
    position: relative;
    z-index: 2;

    width: 100%;
    max-width: 540px;
}

.banner-kicker {
    margin: 0 0 18px;

    color: rgba(255, 255, 255, 0.82);

    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.banner-content h1 {
    max-width: 520px;
    margin: 0 0 22px;

    color: #ffffff;

    font-size: clamp(37px, 4.5vw, 58px);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.035em;
}

.banner-description {
    max-width: 500px;
    margin: 0;

    color: rgba(255, 255, 255, 0.82);

    font-size: 16px;
    font-weight: 400;
    line-height: 1.75;
}

/* =========================================================
   PAINEL DIREITO
========================================================= */

.login-side {
    position: relative;

    min-height: 100vh;
    min-height: 100dvh;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 32px;

    background:
        radial-gradient(
            circle at top right,
            rgba(17, 107, 58, 0.05),
            transparent 32%
        ),
        var(--background);
}

/* =========================================================
   CARTÃO
========================================================= */

.login-card {
    width: 100%;
    max-width: 470px;

    padding: 32px;

    background: var(--surface);

    border: 1px solid rgba(217, 226, 220, 0.9);
    border-radius: 20px;

    box-shadow: var(--shadow);

    transition:
        max-width 0.35s ease,
        padding 0.35s ease,
        transform 0.35s ease;

    animation: cardEntrance 0.45s ease-out;
}

/* =========================================================
   NOME DA MARCA
========================================================= */

.brand-container {
    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 24px;
}

.brand-name {
    margin: 0;

    color: var(--primary);

    font-size: clamp(32px, 4vw, 42px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.05em;
}

/* =========================================================
   TÍTULOS
========================================================= */

.page-title {
    margin: 0 0 9px;

    color: var(--text);

    text-align: center;

    font-size: 24px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.page-description {
    max-width: 390px;
    margin: 0 auto 24px;

    color: var(--muted);

    text-align: center;

    font-size: 13px;
    line-height: 1.65;
}

/* =========================================================
   FORMULÁRIO
========================================================= */

#loginForm,
#activationForm {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-group label {
    color: var(--text);

    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.input-wrap {
    position: relative;
    width: 100%;
}

.form-input {
    width: 100%;
    height: 48px;

    padding: 0 14px 0 46px;

    border: 1px solid var(--border);
    border-radius: 10px;

    outline: none;

    background: var(--surface);
    color: var(--text);

    font-size: 14px;
    font-weight: 500;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

.form-input.has-toggle {
    padding-right: 48px;
}

.form-input::placeholder {
    color: #9aa5a0;
    font-weight: 400;
}

.form-input:hover {
    border-color: #bdcbc2;
}

.form-input:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 3px rgba(17, 107, 58, 0.12);
}

.form-input:disabled {
    cursor: not-allowed;
    background: #f1f4f2;
    color: #89958e;
}

/* =========================================================
   ÍCONES DOS CAMPOS
========================================================= */

.input-icon {
    position: absolute;
    top: 50%;
    left: 15px;

    width: 20px;
    height: 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--primary);

    transform: translateY(-50%);

    pointer-events: none;
}

.input-icon svg {
    width: 19px;
    height: 19px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* =========================================================
   MOSTRAR OU OCULTAR SENHA
========================================================= */

.toggle-password {
    position: absolute;
    top: 50%;
    right: 10px;

    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border-radius: 8px;

    background: transparent;
    color: var(--primary);

    cursor: pointer;

    transform: translateY(-50%);

    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.toggle-password:hover {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.toggle-password svg {
    width: 19px;
    height: 19px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.toggle-password:focus-visible {
    outline: 3px solid rgba(17, 107, 58, 0.18);
    outline-offset: 1px;
}

/* =========================================================
   MENSAGENS
========================================================= */

.form-message {
    display: none;

    padding: 11px 13px;

    border: 1px solid transparent;
    border-radius: 9px;

    font-size: 12px;
    font-weight: 500;
    line-height: 1.55;
}

.form-message.is-visible {
    display: block;
}

.form-message.success {
    background: var(--success-background);
    border-color: rgba(17, 107, 58, 0.14);
    color: var(--success-text);
}

.form-message.error {
    background: var(--error-background);
    border-color: rgba(180, 35, 24, 0.14);
    color: var(--error-text);
}

/* =========================================================
   BOTÃO PRINCIPAL
========================================================= */

.btn-submit {
    width: 100%;
    min-height: 48px;

    padding: 0 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background: var(--primary);
    color: #ffffff;

    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        transform 0.15s ease,
        box-shadow 0.2s ease,
        opacity 0.2s ease;
}

.btn-submit:hover:not(:disabled) {
    background: var(--primary-dark);

    box-shadow:
        0 8px 20px rgba(17, 107, 58, 0.18);

    transform: translateY(-1px);
}

.btn-submit:active:not(:disabled) {
    transform: translateY(0);
}

.btn-submit:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

/* =========================================================
   BOTÃO SECUNDÁRIO
========================================================= */

.btn-secondary {
    width: 100%;
    min-height: 46px;

    padding: 0 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(17, 107, 58, 0.32);
    border-radius: 10px;

    background: transparent;
    color: var(--primary);

    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.15s ease;
}

.btn-secondary:hover {
    border-color: var(--primary);
    background: var(--primary-soft);

    transform: translateY(-1px);
}

/* =========================================================
   LINKS
========================================================= */

.links-area {
    margin-top: 24px;

    color: var(--muted);

    text-align: center;

    font-size: 12px;
    line-height: 1.6;
}

.links-area span {
    display: block;
    margin-bottom: 4px;
}

.links-area a {
    display: inline-block;

    color: var(--primary);

    font-weight: 700;
    text-decoration: none;
}

.links-area a:hover {
    text-decoration: underline;
}

.text-link {
    padding: 3px 5px;

    background: transparent;
    color: var(--primary);

    font-size: 12px;
    font-weight: 600;

    cursor: pointer;
}

.text-link:hover {
    text-decoration: underline;
}

.text-link:focus-visible,
.links-area a:focus-visible,
.btn-submit:focus-visible,
.btn-secondary:focus-visible {
    outline: 3px solid rgba(17, 107, 58, 0.18);
    outline-offset: 3px;
}

.divider {
    width: 100%;
    height: 1px;

    margin: 17px 0;

    background: var(--border);
}

/* =========================================================
   PRIMEIRO ACESSO
========================================================= */

.activation-view {
    animation: activationEntrance 0.35s ease;
}

.activation-heading {
    margin-bottom: 23px;

    text-align: center;
}

.activation-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 29px;
    margin-bottom: 12px;
    padding: 5px 13px;

    border: 1px solid rgba(17, 107, 58, 0.14);
    border-radius: 999px;

    background: var(--primary-soft);
    color: var(--primary);

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.activation-heading h2 {
    margin: 0 0 9px;

    color: var(--text);

    font-size: 23px;
    font-weight: 700;
    line-height: 1.3;
}

.activation-heading p {
    max-width: 390px;
    margin: 0 auto;

    color: var(--muted);

    font-size: 13px;
    line-height: 1.65;
}

.password-rule {
    margin: -2px 0 0;

    color: var(--muted);

    font-size: 11px;
    line-height: 1.55;
}

/* =========================================================
   RODAPÉ DE SEGURANÇA
========================================================= */

.security-footer {
    margin: 18px 0 0;

    color: #7b8880;

    text-align: center;

    font-size: 11px;
    font-weight: 500;
    line-height: 1.5;
}

/* =========================================================
   PORTÁTEIS COM POUCA ALTURA
========================================================= */

@media (min-width: 901px) and (max-height: 760px) {
    .login-side {
        padding: 18px 28px;
    }

    .login-card {
        max-width: 455px;
        padding: 24px 28px;
    }

    .brand-container {
        margin-bottom: 16px;
    }

    .brand-name {
        font-size: 34px;
    }

    .page-title {
        font-size: 21px;
    }

    .page-description {
        margin-bottom: 18px;
        line-height: 1.5;
    }

    #loginForm,
    #activationForm {
        gap: 12px;
    }

    .form-input {
        height: 44px;
    }

    .btn-submit {
        min-height: 44px;
    }

    .links-area {
        margin-top: 17px;
    }

    .divider {
        margin: 12px 0;
    }

    .security-footer {
        margin-top: 10px;
    }

    .banner-content h1 {
        font-size: clamp(35px, 4vw, 49px);
    }
}

/* =========================================================
   TABLETS E TELEMÓVEIS
========================================================= */

@media (max-width: 900px) {
    body {
        overflow-y: auto;
    }

    .main-container {
        display: block;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .banner-side {
        display: none;
    }

    .login-side {
        min-height: 100vh;
        min-height: 100dvh;

        padding: 22px 16px;
    }

    .login-card {
        max-width: 510px;
    }
}

/* =========================================================
   TELEMÓVEIS
========================================================= */

@media (max-width: 520px) {
    .login-side {
        justify-content: flex-start;

        padding: 14px 10px 20px;
    }

    .login-card {
        max-width: 100%;

        padding: 24px 18px;

        border-radius: 16px;
    }

    .brand-container {
        margin-bottom: 19px;
    }

    .brand-name {
        font-size: 34px;
    }

    .page-title {
        font-size: 21px;
    }

    .page-description {
        margin-bottom: 20px;

        font-size: 12px;
        line-height: 1.6;
    }

    #loginForm,
    #activationForm {
        gap: 14px;
    }

    .form-group label {
        font-size: 12px;
    }

    .form-input {
        height: 47px;

        font-size: 13px;
    }

    .btn-submit,
    .btn-secondary {
        min-height: 47px;

        font-size: 13px;
    }

    .links-area {
        margin-top: 20px;
    }

    .activation-heading {
        margin-bottom: 19px;
    }

    .activation-heading h2 {
        font-size: 21px;
    }

    .activation-heading p {
        font-size: 12px;
    }

    .security-footer {
        margin-top: 14px;

        font-size: 10px;
    }
}

/* =========================================================
   ECRÃS MUITO PEQUENOS
========================================================= */

@media (max-width: 360px) {
    .login-side {
        padding: 8px 6px 16px;
    }

    .login-card {
        padding: 21px 14px;
        border-radius: 14px;
    }

    .brand-name {
        font-size: 31px;
    }

    .page-title,
    .activation-heading h2 {
        font-size: 20px;
    }

    .form-input {
        padding-left: 42px;
    }

    .input-icon {
        left: 13px;
    }
}

/* =========================================================
   MOVIMENTO REDUZIDO
========================================================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =========================================================
   ANIMAÇÕES
========================================================= */

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes activationEntrance {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}