/* ==========================================================================
   PRAGSENSE · TELAS DE ACESSO (login, recuperar senha, nova senha, adm)
   Mesma linguagem da landing: a lavoura lida pela IA à esquerda,
   painel sólido com o formulário à direita.
   ========================================================================== */

:root {
    --solo: #050b08;
    --solo-2: #0a1410;
    --solo-3: #0e1a15;
    --linha: rgba(242, 239, 230, 0.09);
    --creme: #f2efe6;
    --texto: rgba(231, 228, 218, 0.66);
    --texto-fraco: rgba(242, 239, 230, 0.42);
    --lima: #c3f56b;
    --lima-glow: rgba(195, 245, 107, 0.35);
    --esmeralda: #34d399;
    --ambar: #ffb547;
    --ferrugem: #ff6b3d;
    --fonte: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --fonte-titulo: 'Outfit', sans-serif;
    --fonte-serif: 'Instrument Serif', Georgia, serif;
    --fonte-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
    --curva: cubic-bezier(0.77, 0, 0.18, 1);
    --acento: var(--lima);
    --acento-glow: var(--lima-glow);
}

/* Perfil consultor troca o acento para âmbar */
.acesso[data-perfil="CONSULTOR"] {
    --acento: var(--ambar);
    --acento-glow: rgba(255, 181, 71, 0.35);
}

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

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--solo);
    color: var(--creme);
    font-family: var(--fonte);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
.mono { font-family: var(--fonte-mono); font-feature-settings: 'tnum' 1, 'zero' 1; }
::selection { background: var(--lima); color: #07130d; }

/* Grão de filme, igual à landing */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 50;
    pointer-events: none;
    opacity: 0.045;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Estrutura: campo (esquerda) + painel (direita)
   -------------------------------------------------------------------------- */
.acesso {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(420px, 34vw, 580px);
    min-height: 100vh;
    min-height: 100svh;
}

.acesso-campo {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(1.6rem, 3vw, 3rem);
    background:
        radial-gradient(ellipse 80% 60% at 55% 100%, rgba(52, 211, 153, 0.12), transparent 70%),
        linear-gradient(180deg, #040907 0%, #050b08 45%, #07110c 100%);
}
.acesso-campo canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    cursor: crosshair;
}
.acesso-vinheta {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(5, 11, 8, 0.75) 0%, rgba(5, 11, 8, 0) 30%, rgba(5, 11, 8, 0) 55%, rgba(5, 11, 8, 0.92) 100%),
        linear-gradient(90deg, rgba(5, 11, 8, 0) 70%, rgba(5, 11, 8, 0.85) 100%);
}

.acesso-marca {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    font-family: var(--fonte-titulo);
    font-weight: 700;
    font-size: 1.45rem;
    letter-spacing: -0.02em;
    color: var(--creme);
    align-self: flex-start;
}
.acesso-marca-icone {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #07130d;
    background: linear-gradient(135deg, #d9f88a, var(--lima) 50%, var(--esmeralda));
    box-shadow: 0 0 26px var(--lima-glow);
}
.acesso-marca em { font-style: normal; color: var(--lima); }
.acesso-marca small {
    margin-left: 0.4rem;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-family: var(--fonte-mono);
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    color: var(--lima);
    border: 1px solid rgba(195, 245, 107, 0.35);
}

.acesso-frase { max-width: min(52rem, 100%); }
.acesso-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0 0 1.3rem;
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--lima);
}
.ponto-vivo {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--lima);
    animation: ponto-vivo 1.8s ease-out infinite;
}
@keyframes ponto-vivo {
    0% { box-shadow: 0 0 0 0 rgba(195, 245, 107, 0.6); }
    100% { box-shadow: 0 0 0 12px rgba(195, 245, 107, 0); }
}

.acesso-frase h1 {
    margin: 0 0 1.8rem;
    font-family: var(--fonte-titulo);
    font-weight: 700;
    font-size: clamp(2.6rem, 5.2vw, 5.4rem);
    line-height: 0.95;
    letter-spacing: -0.045em;
    color: var(--creme);
    text-wrap: balance;
}
.acesso-frase h1 em {
    font-family: var(--fonte-serif);
    font-style: italic;
    font-weight: 400;
    letter-spacing: -0.01em;
    color: var(--lima);
    padding-right: 0.05em;
    text-shadow: 0 0 60px rgba(195, 245, 107, 0.3);
}

/* Leituras ao vivo do campo */
.acesso-leituras {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--linha);
}
.acesso-leituras li {
    padding: 1rem 1.6rem 0 0;
    margin-right: 1.6rem;
    border-right: 1px solid rgba(242, 239, 230, 0.07);
}
.acesso-leituras li:last-child { border-right: none; margin-right: 0; }
.acesso-leituras span {
    display: block;
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--texto-fraco);
}
.acesso-leituras strong {
    display: block;
    margin-top: 0.2rem;
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--creme);
}
.acesso-leituras strong.lima { color: var(--lima); }
.acesso-leituras strong.alerta { color: var(--ferrugem); }

/* --------------------------------------------------------------------------
   Painel do formulário
   -------------------------------------------------------------------------- */
.acesso-painel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(2rem, 4vw, 4rem) clamp(1.6rem, 3.4vw, 3.6rem) 1.6rem;
    background: var(--solo-2);
    border-left: 1px solid var(--linha);
}
.acesso-painel::before {
    /* Fio de luz na borda, na cor do perfil escolhido */
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -1px;
    width: 1px;
    background: linear-gradient(180deg, transparent 10%, var(--acento) 50%, transparent 90%);
    opacity: 0.55;
    transition: background 0.5s;
}

.acesso-form {
    width: 100%;
    max-width: 400px;
    margin: auto;
    animation: acesso-entra 0.9s var(--curva) both;
}
@keyframes acesso-entra {
    from { opacity: 0; transform: translateY(18px); }
}

.acesso-titulo { margin-bottom: 2rem; }
.acesso-titulo .mono {
    display: block;
    margin-bottom: 0.9rem;
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--texto-fraco);
}
.acesso-titulo h2 {
    margin: 0 0 0.5rem;
    font-family: var(--fonte-titulo);
    font-size: 2.3rem;
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.05;
    color: var(--creme);
}
.acesso-titulo p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--texto);
}

/* Seletor Agricultor / Consultor: pílula com indicador deslizante */
.perfil-toggle {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 4px;
    margin-bottom: 1.8rem;
    border-radius: 14px;
    background: var(--solo);
    border: 1px solid var(--linha);
}
.perfil-toggle-indicador {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc(50% - 4px);
    border-radius: 10px;
    background: rgba(195, 245, 107, 0.1);
    border: 1px solid rgba(195, 245, 107, 0.45);
    box-shadow: 0 0 24px -6px var(--acento-glow);
    transition: transform 0.45s var(--curva), background 0.4s, border-color 0.4s;
}
.acesso[data-perfil="CONSULTOR"] .perfil-toggle-indicador {
    transform: translateX(100%);
    background: rgba(255, 181, 71, 0.1);
    border-color: rgba(255, 181, 71, 0.5);
}
.perfil-opcao {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 0.9rem;
    border: none;
    background: none;
    color: var(--texto);
    text-align: left;
    cursor: pointer;
    font: inherit;
    transition: color 0.3s;
}
.perfil-opcao i {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 0.9rem;
    background: rgba(242, 239, 230, 0.05);
    transition: background 0.3s, color 0.3s;
}
.perfil-opcao strong {
    display: block;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--creme);
}
.perfil-opcao small { display: block; font-size: 0.72rem; color: var(--texto-fraco); }
.perfil-opcao[aria-checked="true"] i { background: var(--acento); color: #07130d; }
.perfil-opcao:focus-visible { outline: 2px solid var(--acento); outline-offset: -2px; border-radius: 10px; }

/* Campos */
.campo-form { margin-bottom: 1.25rem; }
.campo-form-topo {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
}
.campo-form label {
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(242, 239, 230, 0.78);
}
.campo-form-topo a,
.acesso-link {
    font-size: 0.8rem;
    color: var(--acento);
    text-decoration: none;
}
.campo-form-topo a:hover,
.acesso-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.entrada {
    position: relative;
    display: flex;
    align-items: center;
}
.entrada > i {
    position: absolute;
    left: 1rem;
    font-size: 0.85rem;
    color: var(--texto-fraco);
    pointer-events: none;
    transition: color 0.25s;
}
.entrada input {
    width: 100%;
    height: 52px;
    padding: 0 3rem 0 2.75rem;
    border-radius: 12px;
    border: 1px solid var(--linha);
    background: var(--solo);
    color: var(--creme);
    font: inherit;
    font-size: 0.95rem;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.entrada input::placeholder { color: rgba(242, 239, 230, 0.28); }
.entrada input:hover { border-color: rgba(242, 239, 230, 0.18); }
.entrada input:focus {
    outline: none;
    border-color: var(--acento);
    background: #07110c;
    box-shadow: 0 0 0 4px rgba(195, 245, 107, 0.1);
}
.acesso[data-perfil="CONSULTOR"] .entrada input:focus { box-shadow: 0 0 0 4px rgba(255, 181, 71, 0.1); }
.entrada:focus-within > i { color: var(--acento); }
.entrada input:-webkit-autofill {
    -webkit-text-fill-color: var(--creme);
    -webkit-box-shadow: 0 0 0 100px var(--solo) inset;
    caret-color: var(--creme);
}
.ver-senha {
    position: absolute;
    right: 0.5rem;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 9px;
    background: none;
    color: var(--texto-fraco);
    cursor: pointer;
}
.ver-senha:hover,
.ver-senha[aria-pressed="true"] { color: var(--acento); background: rgba(242, 239, 230, 0.05); }

.dica-campo {
    margin: 0.45rem 0 0;
    font-size: 0.75rem;
    color: var(--texto-fraco);
}
.dica-campo.erro { color: var(--ferrugem); }

/* Botão principal */
.botao-acesso {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 54px;
    margin-top: 0.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-family: var(--fonte);
    font-size: 0.98rem;
    font-weight: 700;
    color: #07130d;
    background: linear-gradient(135deg, #d9f88a 0%, var(--lima) 45%, #7be495 100%);
    box-shadow: 0 0 0 1px rgba(195, 245, 107, 0.4), 0 14px 40px -12px var(--lima-glow);
    transition: transform 0.25s var(--curva), box-shadow 0.25s, filter 0.25s;
}
.acesso[data-perfil="CONSULTOR"] .botao-acesso {
    background: linear-gradient(135deg, #ffe0a3 0%, var(--ambar) 50%, #ff9f43 100%);
    box-shadow: 0 0 0 1px rgba(255, 181, 71, 0.4), 0 14px 40px -12px rgba(255, 181, 71, 0.45);
}
.botao-acesso:hover { transform: translateY(-2px); filter: brightness(1.06); }
.botao-acesso:active { transform: translateY(0); }
.botao-acesso i { transition: transform 0.3s var(--curva); }
.botao-acesso:hover i { transform: translateX(4px); }
/* Feixe que atravessa o botão ao passar o mouse */
.botao-acesso::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40%;
    left: -50%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    transform: skewX(-20deg);
}
.botao-acesso:hover::after { animation: botao-feixe 0.9s var(--curva); }
@keyframes botao-feixe { to { left: 120%; } }
.botao-acesso.enviando { pointer-events: none; filter: saturate(0.6); }
.botao-acesso.enviando i { animation: girar 0.8s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

.acesso-rodape-form {
    margin-top: 1.8rem;
    padding-top: 1.4rem;
    border-top: 1px dashed var(--linha);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--texto-fraco);
}

.acesso-rodape {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(242, 239, 230, 0.3);
}
.acesso-rodape i { color: var(--esmeralda); margin-right: 0.35rem; }

/* Mensagens (as do controller e as do helper mensagem_helper) */
.aviso,
.acesso .alert {
    position: relative;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 1.4rem;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--creme);
    border: 1px solid var(--linha);
    background: rgba(242, 239, 230, 0.04);
}
.aviso i { margin-top: 0.2rem; }
.aviso.erro,
.acesso .alert-danger { border-color: rgba(255, 107, 61, 0.4); background: rgba(255, 107, 61, 0.08); }
.aviso.erro i { color: var(--ferrugem); }
.aviso.ok,
.acesso .alert-success { border-color: rgba(52, 211, 153, 0.4); background: rgba(52, 211, 153, 0.08); }
.aviso.ok i { color: var(--esmeralda); }
.acesso .alert-warning { border-color: rgba(255, 181, 71, 0.4); background: rgba(255, 181, 71, 0.08); }
.acesso .alert { flex-direction: column; gap: 0.2rem; }
.acesso .alert h4 { margin: 0; font-size: 0.9rem; }
.acesso .alert .close {
    position: absolute;
    top: 0.5rem;
    right: 0.7rem;
    border: none;
    background: none;
    color: var(--texto-fraco);
    font-size: 1.1rem;
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   Responsivo
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    .acesso { grid-template-columns: 1fr; }
    .acesso-campo {
        min-height: 46vh;
        min-height: 46svh;
        padding: 1.4rem 1.4rem 1.8rem;
    }
    .acesso-vinheta {
        background: linear-gradient(180deg, rgba(5, 11, 8, 0.7) 0%, rgba(5, 11, 8, 0) 35%, rgba(5, 11, 8, 0.95) 100%);
    }
    .acesso-frase h1 { font-size: clamp(2.2rem, 8.5vw, 3.4rem); margin-bottom: 1.2rem; }
    .acesso-leituras strong { font-size: 1.15rem; }
    .acesso-painel {
        border-left: none;
        border-top: 1px solid var(--linha);
        padding: 2.2rem 1.4rem 1.4rem;
    }
    .acesso-painel::before {
        top: -1px;
        bottom: auto;
        left: 0;
        right: 0;
        width: auto;
        height: 1px;
        background: linear-gradient(90deg, transparent 10%, var(--acento) 50%, transparent 90%);
    }
}

@media (max-width: 480px) {
    .acesso-leituras li { padding-right: 1rem; margin-right: 1rem; }
    .acesso-leituras li:nth-child(3) { display: none; }
    .perfil-opcao small { display: none; }
    .acesso-titulo h2 { font-size: 2rem; }
    .acesso-rodape { flex-direction: column; gap: 0.4rem; }
}

@media (prefers-reduced-motion: reduce) {
    .ponto-vivo, .acesso-form { animation: none; }
    .perfil-toggle-indicador, .botao-acesso { transition: none; }
}

.acesso-rodape { flex-wrap: wrap; }
.acesso-rodape span { white-space: nowrap; }
