/* css/login.css — 🟢 REDESIGN (verde): mesmo tema do menu lateral e do Dashboard */

:root {
    --forest: #0f3d33;
    --forest-2: #165244;
    --forest-3: #1f6b56;
    --green: #1f8a68;
    --green-hover: #197556;
    --amber: #f2a33a;
    --ink: #15241f;
    --muted: #5f7169;
    --line: #d7e2dc;
    --field-bg: #f6f9f7;
    --danger: #b42318;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    width: 100%;
    min-height: 100%;
    font-family: 'Manrope', sans-serif;
    color: var(--ink);
    background: #fff;
}
.fas { font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free'; }

.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}

/* =======================================
   LADO VERDE (marca + exemplo do fluxo)
   ======================================= */
.login-side {
    position: relative;
    background: var(--forest);
    color: #fff;
    padding: 40px clamp(32px, 5vw, 72px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
    overflow: hidden;
}
/* grade sutil de pontos, só textura */
.login-side::before {
    content: '';
    position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.07) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: linear-gradient(160deg, transparent 20%, #000 100%);
    -webkit-mask-image: linear-gradient(160deg, transparent 20%, #000 100%);
    pointer-events: none;
}
.login-side > * { position: relative; }

.brand-mark {
    width: 34px; height: 34px; flex-shrink: 0;
    border-radius: 10px;
    background: var(--forest-3);
    display: inline-flex; align-items: center; justify-content: center;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-mark img + .brand-dot { display: none; }
.brand-dot {
    width: 13px; height: 13px; border-radius: 50%;
    background: var(--amber);
    box-shadow: 0 0 0 4px rgba(242, 163, 58, 0.22);
}

.side-brand { display: flex; align-items: center; gap: 12px; }
.side-brand-name { font-weight: 800; font-size: 1.1rem; letter-spacing: -0.01em; }

.side-copy h1 {
    font-size: clamp(1.7rem, 2.6vw, 2.5rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.03em;
    max-width: 16ch;
}
.side-copy p { margin-top: 14px; color: #a9c7bc; font-size: 1rem; line-height: 1.55; max-width: 40ch; }

.side-flow { display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap; }
.flow-card {
    flex: 1 0 110px;
    padding: 12px 14px;
    border-radius: 11px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.07);
    display: flex; flex-direction: column; gap: 6px;
}
.flow-card.is-done { background: rgba(52, 211, 153, 0.12); }
.flow-name { display: flex; align-items: center; gap: 7px; font-size: 0.76rem; font-weight: 600; color: #cfe2da; white-space: nowrap; }
.flow-name i { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.flow-count { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.flow-arrow { display: flex; align-items: center; color: #5f8a7c; font-size: 0.7rem; }

/* =======================================
   LADO DO FORMULÁRIO
   ======================================= */
.login-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: #fff;
}
.login-box { width: 100%; max-width: 380px; }

.mobile-brand { display: none; }

.login-box h2 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.subtitle { color: var(--muted); font-size: 0.92rem; line-height: 1.5; margin-top: 6px; margin-bottom: 28px; }

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

.input-wrapper { position: relative; display: flex; align-items: center; }
.input-icon {
    position: absolute; left: 14px;
    color: #8aa198; font-size: 0.9rem;
    pointer-events: none;
    transition: color .15s ease;
}
.input-wrapper input,
.input-wrapper select {
    width: 100%;
    height: 48px;
    padding: 0 44px 0 42px;
    border: 1.5px solid var(--line);
    border-radius: 11px;
    background: var(--field-bg);
    font-family: inherit; font-size: 0.95rem; color: var(--ink);
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
    appearance: none; -webkit-appearance: none;
}
.input-wrapper input::placeholder { color: #9aada5; }
.input-wrapper input:hover,
.input-wrapper select:hover { border-color: #bccdc4; }
.input-wrapper input:focus,
.input-wrapper select:focus {
    outline: none;
    background: #fff;
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(31, 138, 104, 0.14);
}
.input-wrapper:focus-within .input-icon { color: var(--green); }
.company-select { cursor: pointer; }
.select-arrow { position: absolute; right: 16px; color: #8aa198; font-size: 0.8rem; pointer-events: none; }

.toggle-password {
    position: absolute; right: 6px;
    width: 36px; height: 36px;
    border: none; background: transparent; border-radius: 8px;
    color: #8aa198; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.toggle-password:hover { color: var(--ink); background: rgba(15, 61, 51, 0.06); }
.toggle-password:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }

.caps-hint { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-size: 0.78rem; font-weight: 600; color: #9a5b00; }
.caps-hint[hidden] { display: none; }

.login-button {
    width: 100%;
    height: 50px;
    margin-top: 8px;
    border: none;
    border-radius: 11px;
    background: var(--green);
    color: #fff;
    font-family: inherit; font-size: 0.98rem; font-weight: 800;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    transition: background .15s ease, transform .1s ease;
}
.login-button:hover:not(:disabled) { background: var(--green-hover); }
.login-button:active:not(:disabled) { transform: translateY(1px); }
.login-button:focus-visible { outline: 3px solid rgba(31, 138, 104, 0.35); outline-offset: 2px; }
.login-button:disabled { opacity: 0.75; cursor: wait; }

.login-button-secondary {
    background: transparent;
    color: var(--muted);
    border: 1.5px solid var(--line);
    margin-top: 10px;
}
.login-button-secondary:hover:not(:disabled) { background: var(--field-bg); color: var(--ink); }

.help-text { margin-top: 18px; color: var(--muted); font-size: 0.82rem; line-height: 1.5; }
.help-text strong { color: var(--ink); }

.error-message {
    margin-top: 16px;
    padding: 11px 14px;
    border-radius: 10px;
    background: #fdecea;
    border: 1px solid #f6c9c4;
    color: var(--danger);
    font-size: 0.86rem; font-weight: 600; line-height: 1.45;
}
.error-message:empty { display: none; }

.login-footer { margin-top: 36px; color: #9aada5; font-size: 0.78rem; }

/* =======================================
   RESPONSIVO
   ======================================= */
@media (max-width: 1100px) {
    .flow-arrow { display: none; }
    .flow-card { flex-basis: 40%; }
}

@media (max-width: 860px) {
    .login-page { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .login-side { padding: 22px 20px 26px; gap: 18px; }
    .side-copy h1 { font-size: 1.35rem; max-width: 24ch; }
    .side-copy p, .side-flow { display: none; }
    .login-main { align-items: flex-start; padding: 32px 20px 28px; }
    .login-box { max-width: 440px; }
    .login-footer { margin-top: 28px; }
}

@media (prefers-reduced-motion: no-preference) {
    .login-box { animation: boxIn .45s cubic-bezier(.2,.7,.3,1) both; }
    @keyframes boxIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
