: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;
    --border-hover: #bdcbc2;

    --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 {
    border: 0;
    -webkit-tap-highlight-color: transparent;
}

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

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

    display: grid;
    grid-template-columns: minmax(400px, 44%) minmax(520px, 56%);
}

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

.left-panel {
    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;
}

.left-panel::before {
    content: "";

    position: absolute;
    inset: 0;

    background:
        radial-gradient(
            circle at 20% 20%,
            rgba(255, 255, 255, 0.09),
            transparent 34%
        ),
        radial-gradient(
            circle at 82% 85%,
            rgba(255, 255, 255, 0.05),
            transparent 30%
        );

    pointer-events: none;
}

#network {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    z-index: 1;
}

.overlay {
    position: relative;
    z-index: 2;

    width: 100%;
    max-width: 520px;

    text-align: left;
}

.overlay h1 {
    margin: 0 0 22px;

    color: #ffffff;

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

.overlay p {
    max-width: 500px;
    margin: 0 0 20px;

    color: #ffffff;

    font-size: clamp(21px, 2.3vw, 29px);
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.025em;
}

.overlay span {
    display: block;

    max-width: 470px;

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

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

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

.right-panel {
    position: relative;

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

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

    padding: 26px;

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

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

.card {
    width: 100%;
    max-width: 650px;

    padding: 30px;

    background: var(--surface);

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

    box-shadow: var(--shadow);

    animation: cardEntrance 0.45s ease-out;
}

.card h2 {
    margin: 0 0 8px;

    color: var(--primary);

    font-size: clamp(23px, 2.4vw, 29px);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.025em;
}

.card-description {
    margin: 0 0 23px;

    color: var(--muted);

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

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

#registerForm {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px 16px;
}

.form-group {
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 7px;
}

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

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

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

    padding: 0 14px;

    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-group input:hover {
    border-color: var(--border-hover);
}

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

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

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

.form-group input:disabled {
    cursor: not-allowed;

    background: #f1f4f2;
    color: #89958e;
}

/* =========================================================
   VALIDAÇÃO DOS CAMPOS
========================================================= */

.form-group input:user-invalid {
    border-color: rgba(180, 35, 24, 0.65);
}

.form-group input:user-invalid:focus {
    border-color: var(--error-text);

    box-shadow:
        0 0 0 3px rgba(180, 35, 24, 0.11);
}

.form-group input:user-valid {
    border-color: rgba(17, 107, 58, 0.45);
}

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

.form-message {
    display: none;

    grid-column: 1 / -1;

    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 DE CADASTRO
========================================================= */

#registerBtn {
    grid-column: 1 / -1;

    width: 100%;
    min-height: 48px;

    margin-top: 2px;
    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;
}

#registerBtn:hover:not(:disabled) {
    background: var(--primary-dark);

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

    transform: translateY(-1px);
}

#registerBtn:active:not(:disabled) {
    transform: translateY(0);
}

#registerBtn:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

#registerBtn:focus-visible {
    outline: 3px solid rgba(17, 107, 58, 0.2);
    outline-offset: 3px;
}

/* =========================================================
   ECRÃS DE LARGURA INTERMÉDIA
========================================================= */

@media (max-width: 1120px) {
    .container {
        grid-template-columns: minmax(360px, 42%) minmax(470px, 58%);
    }

    .left-panel {
        padding: 36px;
    }

    .right-panel {
        padding: 20px;
    }

    .card {
        max-width: 510px;
        padding: 27px;
    }

    #registerForm {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .form-message,
    #registerBtn {
        grid-column: auto;
    }

    .form-group input {
        height: 43px;
    }

    #registerBtn {
        min-height: 45px;
    }
}

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

@media (min-width: 901px) and (max-height: 760px) {
    .left-panel {
        padding: 30px;
    }

    .overlay h1 {
        margin-bottom: 14px;
        font-size: 42px;
    }

    .overlay p {
        margin-bottom: 14px;
        font-size: 21px;
    }

    .overlay span {
        font-size: 13px;
        line-height: 1.6;
    }

    .right-panel {
        padding: 12px 20px;
    }

    .card {
        max-width: 630px;
        padding: 22px 26px;
        border-radius: 16px;
    }

    .card h2 {
        margin-bottom: 5px;
        font-size: 23px;
    }

    .card-description {
        margin-bottom: 16px;
        font-size: 12px;
        line-height: 1.5;
    }

    #registerForm {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px 14px;
    }

    .form-message,
    #registerBtn {
        grid-column: 1 / -1;
    }

    .form-group {
        gap: 4px;
    }

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

    .form-group input {
        height: 40px;
        border-radius: 8px;
        font-size: 13px;
    }

    #registerBtn {
        min-height: 42px;
        margin-top: 0;
    }
}

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

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

    .container {
        display: block;

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

    .left-panel {
        display: none;
    }

    .right-panel {
        min-height: 100vh;
        min-height: 100dvh;

        padding: 22px 16px;
    }

    .card {
        max-width: 540px;
    }

    #registerForm {
        grid-template-columns: 1fr;
    }

    .form-message,
    #registerBtn {
        grid-column: auto;
    }
}

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

@media (max-width: 520px) {
    .right-panel {
        align-items: flex-start;

        padding: 12px 10px 20px;
    }

    .card {
        max-width: 100%;

        padding: 23px 18px;

        border-radius: 16px;
    }

    .card h2 {
        font-size: 22px;
    }

    .card-description {
        margin-bottom: 19px;

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

    #registerForm {
        gap: 12px;
    }

    .form-group {
        gap: 6px;
    }

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

    .form-group input {
        height: 46px;

        font-size: 13px;
    }

    #registerBtn {
        min-height: 47px;

        font-size: 13px;
    }

    .form-message {
        font-size: 11px;
    }
}

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

@media (max-width: 360px) {
    .right-panel {
        padding: 7px 6px 16px;
    }

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

    .card h2 {
        font-size: 20px;
    }

    .form-group input {
        padding: 0 12px;
    }
}

/* =========================================================
   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ÇÃO
========================================================= */

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

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