:root {
    --ink: #344354;
    --ink-soft: #6e7a87;
    --paper: #f2f5f8;
    --surface: #ffffff;
    --surface-muted: #edf1f5;
    --forest: #3f526b;
    --forest-2: #526b88;
    --mint: #c4d1df;
    --mint-strong: #627f9f;
    --line: #d9dfe5;
    --danger: #8a4e4e;
    --font-body: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-heading: "Manrope", var(--font-body);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --ink: #e7edf3;
    --ink-soft: #9eabb8;
    --paper: #111820;
    --surface: #19232d;
    --surface-muted: #222e39;
    --forest: #31445a;
    --forest-2: #9bb1c8;
    --mint: #40566d;
    --mint-strong: #a8bdd2;
    --line: #34424f;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

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

a {
    color: inherit;
    text-decoration: none;
}

svg {
    width: 19px;
    height: 19px;
    stroke-width: 1.8;
}

.login-layout {
    min-height: 100svh;
}

.login-brand-panel {
    display: none;
}

.login-main {
    position: relative;
    display: grid;
    min-height: 100svh;
    place-items: center;
    padding: 74px 18px 34px;
}

.login-theme-button {
    position: absolute;
    top: 18px;
    right: 18px;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 8px 24px rgba(51, 67, 84, 0.1);
    cursor: pointer;
}

.login-card {
    width: min(100%, 430px);
    padding: 28px 22px 22px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: 0 24px 70px rgba(52, 67, 84, 0.12);
}

.login-logo {
    display: block;
    width: 142px;
    margin: 0 auto 30px;
}

.login-logo img {
    display: block;
    width: 100%;
    height: auto;
}

.login-heading {
    text-align: center;
}

.secure-access {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--forest-2);
    font-size: 0.68rem;
    font-weight: 700;
}

.secure-access svg {
    width: 15px;
    height: 15px;
}

.login-heading h1 {
    margin: 15px 0 7px;
    font-family: var(--font-heading);
    font-size: clamp(1.75rem, 8vw, 2.15rem);
    letter-spacing: -0.045em;
}

.login-heading p {
    max-width: 330px;
    margin: 0 auto;
    color: var(--ink-soft);
    font-size: 0.8rem;
    line-height: 1.55;
}

.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 20px;
    padding: 12px;
    border-left: 3px solid var(--danger);
    background: #f3eeee;
    color: #744f4f;
    font-size: 0.72rem;
    line-height: 1.45;
}

.login-alert svg {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
}

.login-alert ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.login-form {
    display: grid;
    gap: 17px;
    margin-top: 25px;
}

.login-field label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.75rem;
    font-weight: 700;
}

.login-input {
    position: relative;
}

.login-input > svg {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 13px;
    width: 18px;
    height: 18px;
    color: var(--ink-soft);
    transform: translateY(-50%);
    pointer-events: none;
}

.login-input input {
    width: 100%;
    min-height: 50px;
    padding: 12px 13px 12px 42px;
    border: 1px solid #cfd6dd;
    border-radius: 12px;
    outline: 0;
    background: #fbfcfd;
    color: var(--ink);
    font-size: 0.87rem;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.login-password-input input {
    padding-right: 48px;
}

.login-input input:focus {
    border-color: var(--mint-strong);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(98, 127, 159, 0.14);
}

.login-input input::placeholder {
    color: #9ba5af;
}

.login-password-input button {
    position: absolute;
    top: 50%;
    right: 6px;
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--ink-soft);
    transform: translateY(-50%);
    cursor: pointer;
}

.login-password-input button:hover {
    background: var(--surface-muted);
    color: var(--ink);
}

.login-field small {
    display: block;
    margin-top: 6px;
    color: var(--ink-soft);
    font-size: 0.64rem;
}

.login-field-error {
    display: block;
    margin-top: 6px;
    color: var(--danger);
    font-size: 0.68rem;
    font-weight: 600;
}

.login-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 51px;
    margin-top: 3px;
    border: 0;
    border-radius: 12px;
    background: var(--forest);
    color: #ffffff;
    font-size: 0.84rem;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(63, 82, 107, 0.22);
    cursor: pointer;
}

.login-submit:hover {
    background: var(--forest-2);
}

.login-security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 0.64rem;
}

.login-security-note svg {
    width: 14px;
    height: 14px;
}

html[data-theme="dark"] .login-card,
html[data-theme="dark"] .login-theme-button {
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.26);
}

html[data-theme="dark"] .login-input input {
    border-color: #3b4a58;
    background: #202b36;
}

html[data-theme="dark"] .login-input input:focus {
    background: #25323e;
}

html[data-theme="dark"] .login-alert {
    background: #3a2e33;
    color: #d5b6bf;
}

@media (min-width: 620px) {
    .login-card {
        padding: 38px 40px 30px;
    }
}

@media (min-width: 960px) {
    .login-layout {
        display: grid;
        grid-template-columns: minmax(360px, 0.9fr) minmax(520px, 1.1fr);
    }

    .login-brand-panel {
        display: flex;
        min-height: 100vh;
        flex-direction: column;
        justify-content: space-between;
        padding: 64px clamp(42px, 6vw, 88px) 42px;
        background: var(--forest);
        color: #ffffff;
    }

    .login-brand-content {
        max-width: 520px;
        margin: auto 0;
    }

    .login-brand-mark {
        display: grid;
        width: 54px;
        height: 54px;
        margin-bottom: 38px;
        place-items: center;
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.1);
        color: var(--mint);
    }

    .login-brand-mark svg {
        width: 28px;
        height: 28px;
    }

    .login-brand-content > p {
        margin: 0 0 12px;
        color: #c4d1df;
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .login-brand-content h2 {
        max-width: 490px;
        margin: 0;
        font-family: var(--font-heading);
        font-size: clamp(2rem, 3.2vw, 3.35rem);
        line-height: 1.12;
        letter-spacing: -0.05em;
    }

    .login-brand-content ul {
        display: grid;
        gap: 14px;
        margin: 40px 0 0;
        padding: 0;
        list-style: none;
        color: #d9e2eb;
        font-size: 0.82rem;
    }

    .login-brand-content li {
        display: flex;
        align-items: center;
        gap: 9px;
    }

    .login-brand-content li svg {
        width: 17px;
        height: 17px;
        color: var(--mint);
    }

    .login-brand-panel > small {
        color: #b7c4d2;
        font-size: 0.66rem;
    }

    .login-main {
        min-height: 100vh;
        padding: 52px;
    }

    .login-theme-button {
        top: 28px;
        right: 30px;
    }
}

/* Evita o zoom automático do Safari no iOS ao focar os campos de login. */
@media (max-width: 619px) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]),
    select,
    textarea {
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
