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

.lg {
    --lg-fundo: var(--fl-creme, #f9f0df);
    --lg-cartao: #ffffff;
    --lg-tx: var(--fl-navy, #0b2c45);
    --lg-tx-2: #4a5d6b;
    --lg-borda: #e5dfd4;
    --lg-campo: #ffffff;
    --lg-placeholder: #6b7a86;
    --lg-hover: #f4f1ea;
    --lg-acao: var(--fl-navy, #0b2c45);
    --lg-acao-tx: #ffffff;
    --lg-acao-hover: color-mix(in srgb, var(--lg-acao) 86%, #000);
    --lg-coral: linear-gradient(180deg, #ff960e 0%, #fd7444 50%, #f0283c 100%);
    --lg-bloco: 600px;
    --lg-pad-esq: clamp(16px, 2.5vw, 48px);
    --lg-pad-dir: clamp(24px, 4vw, 72px);
    --lg-cartao-max: 540px;
    --lg-erro: #b42318;
    --lg-aviso: #8a5a0c;
}
html[data-marca="sim"] .lg { --lg-acao: #2b8526; }

html, body {
    margin: 0;
    min-height: 100%;
    font-family: var(--font-brand, "Alan Sans", Arial, sans-serif);
    color: var(--fl-navy, #0b2c45);
    background: var(--fl-creme, #f9f0df);
}

.lg {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--lg-fundo);
    color: var(--lg-tx);
}

.lg-marca {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: clamp(20px, 4vh, 40px);
    padding: clamp(28px, 6vh, 64px) clamp(24px, 3.5vw, 64px) clamp(28px, 5vh, 52px) clamp(28px, 5vw, 96px);
    overflow: hidden;
}
.lg-cliente,
.lg-chamada,
.lg-endosso { width: 100%; max-width: var(--lg-bloco); margin-left: auto; }
.lg-cliente { position: relative; z-index: 1; }
.lg-logo { display: block; height: clamp(72px, 9vh, 104px); width: auto; max-width: 280px; object-fit: contain; }
html[data-marca="super"] .lg-logo { height: clamp(40px, 5.4vh, 54px); max-width: 260px; }
html[data-marca="flua"] .lg-logo { height: clamp(44px, 6vh, 60px); }

.lg-chamada { position: relative; z-index: 1; margin-top: auto; margin-bottom: auto; }
.lg-produto {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--lg-tx);
}
.lg-chamada h2 {
    margin: clamp(10px, 1.6vh, 16px) 0 0;
    font-size: clamp(34px, min(2.6vw + 14px, 7.4vh), 60px);
    line-height: 1.06;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--lg-tx);
    text-wrap: balance;
}
.lg-chamada p { margin: clamp(10px, 1.8vh, 18px) 0 0; font-size: clamp(16px, min(0.5vw + 12px, 2.8vh), 20px); line-height: 1.5; color: var(--lg-tx-2); max-width: 520px; }

.lg-jornada { width: 100%; max-width: 540px; margin-top: clamp(16px, 4.4vh, 44px); }
.lg-sobre {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--lg-tx-2);
}
.lg-jornada svg { display: block; width: 100%; height: auto; overflow: visible; }
.lg-trilha-base { fill: none; stroke: var(--lg-borda); stroke-width: 2; }
.lg-trilha {
    fill: none;
    stroke: url(#lg-degrade);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: lg-desenha 2.2s var(--fl-ease-chega, ease-out) 0.3s forwards;
}
.lg-no circle.lg-no-fundo { fill: var(--lg-cartao); stroke: color-mix(in srgb, var(--lg-tx) 30%, transparent); stroke-width: 2; }
.lg-no circle.lg-no-miolo { fill: var(--lg-tx); }
.lg-no text { fill: var(--lg-tx); font-size: 13px; font-weight: 700; font-family: inherit; }
.lg-no text.lg-no-sub { fill: var(--lg-tx-2); font-size: 10.5px; font-weight: 600; }
.lg-no { opacity: 0; animation: lg-surge 0.5s var(--fl-ease-chega, ease-out) forwards; }
.lg-no:nth-of-type(1) { animation-delay: 0.5s; }
.lg-no:nth-of-type(2) { animation-delay: 1.15s; }
.lg-no:nth-of-type(3) { animation-delay: 1.8s; }
.lg-no-ativo circle.lg-no-fundo { stroke: #ff9612; }
.lg-no-ativo circle.lg-no-miolo { fill: url(#lg-degrade); }
.lg-pulso { fill: none; stroke: #ff9612; stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; animation: lg-pulsa 2.4s ease-out 2.3s infinite; }

.lg-endosso {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 0 auto;
    font-size: 14px;
    color: var(--lg-tx-2);
}
.lg-endosso-marca { font-weight: 600; color: var(--lg-tx); }
.lg-endosso-flua { height: 20px; width: auto; margin-left: 2px; }

.lg-lado-form {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: clamp(28px, 6vh, 64px) var(--lg-pad-dir) clamp(64px, 10vh, 96px) var(--lg-pad-esq);
}
.lg-arco {
    position: absolute;
    top: clamp(40px, 10vh, 104px);
    bottom: 0;
    left: calc(var(--lg-pad-esq) + min(var(--lg-cartao-max), 100% - var(--lg-pad-esq) - var(--lg-pad-dir)) / 2);
    width: min(var(--lg-cartao-max) + 100px, 100% - 16px);
    transform: translateX(-50%);
    border: 3px solid transparent;
    border-bottom: 0;
    border-radius: 999px 999px 0 0;
    background: var(--lg-coral) border-box;
    -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0) border-box;
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) padding-box exclude, linear-gradient(#000 0 0) border-box;
    pointer-events: none;
}
.lg-cartao {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: var(--lg-cartao-max);
    padding: clamp(28px, min(3.2vw, 5.6vh), 56px);
    border-radius: 24px;
    background: var(--lg-cartao);
    box-shadow: 0 24px 50px -24px rgba(11, 44, 69, 0.28);
    animation: lg-entra 0.6s var(--fl-ease-chega, ease-out) backwards;
}

.lg-titulo { margin: 0; font-size: clamp(28px, 2.4vw, 34px); font-weight: 700; letter-spacing: -0.02em; color: var(--lg-tx); }
.lg-sub { margin: 8px 0 clamp(18px, 3vh, 26px); font-size: 15px; color: var(--lg-tx-2); }
.lg-sub strong { font-weight: 400; color: inherit; }

.lg-alerta {
    display: none;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    border-left: 3px solid var(--fl-erro-forte, #d0182b);
    background: var(--fl-erro-tint, #fbd9dd);
    color: var(--fl-erro, #a3121f);
    font-size: 0.86rem;
    font-weight: 600;
    animation: lg-treme 0.36s ease;
}
.lg-alerta.show { display: flex; }
.lg-alerta i { margin-top: 2px; }
.lg-alerta.alert-success { border-left-color: var(--fl-ok, #0e7a53); background: var(--fl-ok-tint, #d9f4e8); color: var(--fl-ok, #0e7a53); animation: none; }
.lg-alerta.alert-success i::before { content: "\f058"; }

.lg-campo { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.lg-campo label { font-size: 13px; font-weight: 700; color: var(--lg-tx); }
.lg-input {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 54px;
    padding: 0 8px 0 14px;
    border: 1px solid var(--lg-borda);
    border-radius: 12px;
    background: var(--lg-campo);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.lg-input:focus-within { border-color: var(--lg-acao); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lg-acao) 14%, transparent); }
.lg-input.lg-input-erro, .lg-input.lg-input-erro:focus-within { border-color: var(--lg-erro); box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.1); }
.lg-input > i { display: none; }
.lg-input input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: 16px;
    font-weight: 500;
    color: var(--lg-tx);
}
.lg-input input:focus-visible { outline: none; box-shadow: none; }
.lg-input input::placeholder { color: var(--lg-placeholder); font-weight: 400; }
.lg-input input:-webkit-autofill,
.lg-input input:-webkit-autofill:hover,
.lg-input input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--lg-campo) inset;
    box-shadow: 0 0 0 1000px var(--lg-campo) inset;
    -webkit-text-fill-color: var(--lg-tx);
    caret-color: var(--lg-tx);
    transition: background-color 600000s 0s;
}
.lg-input input:autofill { box-shadow: 0 0 0 1000px var(--lg-campo) inset; }
.lg-mostrar {
    flex: none;
    height: 34px;
    padding: 0 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--lg-tx);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.lg-mostrar:hover { background: var(--lg-hover); }
.lg-mostrar:focus-visible { outline: 2px solid var(--lg-acao); outline-offset: 1px; }
.lg-dica { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--lg-aviso); }
.lg-dica::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #c4761e; }
.lg-dica[hidden] { display: none; }

.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 56px;
    margin-top: 2px;
    border: none;
    border-radius: 10px;
    background: var(--lg-acao);
    color: var(--lg-acao-tx);
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-login:hover:not(:disabled) { background: var(--lg-acao-hover); }
.btn-login:focus-visible { outline: 3px solid color-mix(in srgb, var(--lg-acao) 35%, transparent); outline-offset: 2px; }
.btn-login:disabled { opacity: 0.75; cursor: progress; }
.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid color-mix(in srgb, currentColor 45%, transparent);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: lg-gira 0.8s linear infinite;
}
.lg-ocupado .lg-input { pointer-events: none; }

.lg-troca-info {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: var(--lg-hover);
    border-left: 3px solid #ff9612;
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--lg-tx);
}
.lg-troca-info i { color: var(--lg-aviso); margin-top: 2px; }
.lg-voltar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 12px -6px;
    padding: 4px 6px;
    border: none;
    border-radius: 8px;
    background: none;
    color: var(--lg-tx-2);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.lg-voltar:hover { color: var(--lg-tx); background: var(--lg-hover); }
.lg-etapa { animation: lg-entra 0.45s var(--fl-ease-chega, ease-out) backwards; }

.lg-versao {
    position: absolute;
    left: calc(50% + var(--lg-pad-esq) + min(var(--lg-cartao-max), 50% - var(--lg-pad-esq) - var(--lg-pad-dir)) / 2);
    bottom: clamp(14px, 3vh, 28px);
    z-index: 2;
    display: flex;
    gap: 14px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--lg-fundo);
    transform: translateX(-50%);
    font-size: 12px;
    white-space: nowrap;
    color: var(--lg-tx-2);
}
.lg-versao span[hidden] { display: none; }
.lg-versao span:not([hidden]) ~ span::before { content: '·'; margin-right: 14px; }

html[data-theme="dark"] .lg {
    --lg-fundo: #10283a;
    --lg-cartao: transparent;
    --lg-tx: #eaf2f6;
    --lg-tx-2: #a9bcc9;
    --lg-borda: #2a4a61;
    --lg-campo: #10283a;
    --lg-placeholder: #8fa4b3;
    --lg-hover: #163247;
    --lg-erro: #ff8a80;
    --lg-aviso: #ffc46b;
}
html[data-theme="dark"][data-marca="flua"] .lg,
html[data-theme="dark"][data-marca="super"] .lg { --lg-acao: var(--fl-agua, #cceef0); --lg-acao-tx: var(--fl-navy, #0b2c45); --lg-acao-hover: #ffffff; }
html[data-theme="dark"],
html[data-theme="dark"] body { background: #10283a; }
html[data-theme="dark"] .lg-cartao { box-shadow: none; }
html[data-theme="dark"] .lg-arco { opacity: 0.6; }
html[data-theme="dark"] .lg-no circle.lg-no-fundo { fill: #10283a; }
html[data-theme="dark"] .lg-troca-info { background: #163247; }

@keyframes lg-desenha { to { stroke-dashoffset: 0; } }
@keyframes lg-surge { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes lg-pulsa { 0% { opacity: 0.8; transform: scale(1); } 100% { opacity: 0; transform: scale(2.2); } }
@keyframes lg-entra { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes lg-treme { 0%, 100% { transform: none; } 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
@keyframes lg-gira { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
    .lg-marca { padding-left: clamp(24px, 4vw, 48px); }
}

@media (max-height: 640px) and (min-width: 901px) {
    .lg-sobre { display: none; }
    .lg-jornada { max-width: 440px; }
}

@media (max-width: 900px) {
    .lg { display: flex; flex-direction: column; }
    .lg-marca { display: contents; }
    .lg-cliente { order: 1; max-width: none; margin: 0; padding: 28px 24px 0; }
    .lg-chamada { order: 2; max-width: none; margin: 0; padding: 20px 24px 0; }
    .lg-lado-form { order: 3; flex: 1; align-items: flex-start; justify-content: center; padding: 22px 16px 16px; }
    .lg-endosso { order: 4; max-width: none; margin: 0; padding: 8px 24px 0; justify-content: center; }
    .lg-versao { order: 5; position: static; transform: none; justify-content: center; margin: 4px auto 20px; background: transparent; }
    .lg-arco, .lg-jornada, .lg-chamada p { display: none; }
    .lg-produto { font-size: 11px; }
    .lg-chamada h2 { font-size: clamp(24px, 5.4vw, 34px); }
    .lg-logo { height: 52px; }
    html[data-marca="super"] .lg-logo { height: 34px; }
    html[data-marca="flua"] .lg-logo { height: 36px; }
    .lg-cartao { max-width: 520px; padding: 28px 22px; }
}

@media (max-width: 380px) {
    .lg-cliente { padding: 22px 16px 0; }
    .lg-chamada { padding: 16px 16px 0; }
    .lg-lado-form { padding: 16px 12px 12px; }
    .lg-cartao { padding: 24px 18px; }
    .lg-endosso { padding-left: 16px; padding-right: 16px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
    .lg-trilha { animation: none; stroke-dashoffset: 0; }
    .lg-no { animation: none; opacity: 1; }
    .lg-pulso { display: none; }
    .lg-cartao, .lg-etapa, .lg-alerta { animation: none; }
}
