/* Login INSMED — identidade: vermelho #b73735 / #922b2a, tinta #1f2933, fundo #f8f6f6 */
:root {
    --red: #b73735;
    --red-dark: #922b2a;
    --red-deep: #6e1d1c;
    --red-soft: #fbeeee;
    --ink: #1f2933;
    --muted: #697780;
    --line: #e5dddd;
    --bg: #f8f6f6;
    --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    font-family: Inter, "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

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

/* ---- Lado da marca ------------------------------------------------------ */
.brand-side {
    --mx: 30%;
    --my: 30%;
    position: relative;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(600px circle at var(--mx) var(--my), rgba(255, 255, 255, .14), transparent 60%),
        linear-gradient(145deg, var(--red) 0%, var(--red-dark) 55%, var(--red-deep) 100%);
    display: flex;
    align-items: center;
    padding: 56px clamp(28px, 6vw, 88px);
    isolation: isolate;
}
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: .55;
    z-index: -1;
    animation: float 18s ease-in-out infinite;
}
.b1 { width: 420px; height: 420px; background: #e0605d; top: -120px; left: -100px; }
.b2 { width: 360px; height: 360px; background: #5e1615; bottom: -120px; right: -60px; animation-delay: -6s; }
.b3 { width: 260px; height: 260px; background: #ff8a80; top: 40%; left: 55%; opacity: .3; animation-delay: -12s; }
@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, -30px) scale(1.08); }
    66% { transform: translate(-30px, 25px) scale(.95); }
}
.grid-dots {
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(rgba(255, 255, 255, .13) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
}

/* Linha de batimento (vem da própria logo) */
.ecg {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 9%;
    width: 100%;
    height: 140px;
    z-index: -1;
    opacity: .35;
}
.ecg polyline {
    stroke: #fff;
    stroke-width: 2.5;
    stroke-dasharray: 1400;
    stroke-dashoffset: 1400;
    animation: ecg 5.5s linear infinite;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, .7));
}
@keyframes ecg {
    0% { stroke-dashoffset: 1400; }
    60% { stroke-dashoffset: 0; opacity: 1; }
    85%, 100% { stroke-dashoffset: 0; opacity: 0; }
}

.brand-content { max-width: 540px; }
.logo-card {
    display: inline-block;
    background: #fff;
    border-radius: 18px;
    padding: 14px 18px;
    box-shadow: 0 20px 50px rgba(40, 6, 6, .35);
    transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.logo-card:hover { transform: translateY(-4px) rotate(-.6deg); box-shadow: 0 28px 60px rgba(40, 6, 6, .45); }
.logo-card img { display: block; width: min(320px, 70vw); height: auto; }

.headline {
    margin: 38px 0 14px;
    font-size: clamp(28px, 3.2vw, 42px);
    line-height: 1.12;
    letter-spacing: -1px;
    font-weight: 800;
}
.rotator {
    display: inline-block;
    position: relative;
    color: #ffd9d6;
    min-width: 6ch;
}
.rotator span { display: inline-block; }
.rotator span.out { animation: wordOut .35s var(--ease) forwards; }
.rotator span.in { animation: wordIn .45s var(--ease) both; }
@keyframes wordOut { to { opacity: 0; transform: translateY(-14px); filter: blur(4px); } }
@keyframes wordIn { from { opacity: 0; transform: translateY(14px); filter: blur(4px); } }
.rotator::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 2px;
    height: 6px;
    background: rgba(255, 255, 255, .18);
    border-radius: 6px;
    z-index: -1;
}
.lead { margin: 0 0 30px; font-size: 16px; line-height: 1.6; color: rgba(255, 255, 255, .85); max-width: 460px; }

.features { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.features li {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .12);
    backdrop-filter: blur(6px);
    transition: background .3s, transform .3s var(--ease), border-color .3s;
}
.features li:hover { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .3); transform: translateX(6px); }
.features .ico {
    flex: none;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: rgba(255, 255, 255, .16);
}
.features .ico svg { width: 21px; height: 21px; }
.features strong { display: block; font-size: 15px; }
.features small { display: block; margin-top: 3px; font-size: 13px; line-height: 1.45; color: rgba(255, 255, 255, .78); }

/* ---- Lado do formulário ------------------------------------------------- */
.form-side {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 40px clamp(20px, 5vw, 64px) 22px;
    background:
        radial-gradient(800px circle at 100% 0%, #fff 0%, transparent 60%),
        var(--bg);
}
.form-wrap {
    flex: 1;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    perspective: 1200px;
}

.login-card {
    position: relative;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 36px 34px 26px;
    box-shadow: 0 1px 2px rgba(31, 41, 51, .04), 0 24px 60px rgba(146, 43, 42, .10);
    transform-style: preserve-3d;
    transition: transform .25s var(--ease), box-shadow .3s;
    will-change: transform;
}
.login-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 28px;
    right: 28px;
    height: 4px;
    border-radius: 0 0 6px 6px;
    background: linear-gradient(90deg, var(--red), #e0605d, var(--red));
    background-size: 200% 100%;
    animation: sheen 6s linear infinite;
}
@keyframes sheen { to { background-position: 200% 0; } }
.card-logo { display: none; width: 220px; height: auto; margin-bottom: 18px; }

.eyebrow { margin: 0 0 8px; color: var(--red); font-size: 11px; font-weight: 800; letter-spacing: 1.6px; }
h1 { margin: 0 0 6px; font-size: 28px; letter-spacing: -.7px; }
.muted { margin: 0 0 24px; color: var(--muted); font-size: 14px; line-height: 1.5; }

.alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: #fdecec;
    border: 1px solid #f3c4c4;
    color: #a12523;
    border-radius: 12px;
    padding: 12px 14px;
    margin: -6px 0 18px;
    font-size: 14px;
    animation: shake .5s var(--ease);
}
.alert svg { flex: none; width: 20px; height: 20px; }
@keyframes shake {
    20%, 60% { transform: translateX(-7px); }
    40%, 80% { transform: translateX(7px); }
}

.float-field { position: relative; margin-bottom: 16px; }
.float-field input {
    width: 100%;
    height: 58px;
    padding: 22px 46px 6px 46px;
    border: 1.5px solid #ddd3d3;
    border-radius: 14px;
    background: #fcfbfb;
    font: inherit;
    font-size: 15px;
    color: var(--ink);
    transition: border-color .2s, background .2s, box-shadow .2s;
}
.float-field input:hover { border-color: #cdb5b4; background: #fff; }
.float-field input:focus { outline: 0; border-color: var(--red); background: #fff; box-shadow: 0 0 0 4px rgba(183, 55, 53, .12); }
.float-field label {
    position: absolute;
    left: 46px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 15px;
    pointer-events: none;
    transition: top .2s var(--ease), font-size .2s var(--ease), color .2s, transform .2s var(--ease);
}
.float-field input:focus + label,
.float-field input:not(:placeholder-shown) + label {
    top: 17px;
    transform: none;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .3px;
    color: var(--red);
}
.float-field input:not(:focus):not(:placeholder-shown) + label { color: var(--muted); }
.lead-ico {
    position: absolute;
    left: 16px;
    top: 50%;
    width: 19px;
    height: 19px;
    transform: translateY(-50%);
    color: #a8999a;
    transition: color .2s, transform .2s var(--ease);
    pointer-events: none;
}
.float-field:focus-within .lead-ico { color: var(--red); transform: translateY(-50%) scale(1.1); }
.focus-line {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 0;
    height: 2px;
    border-radius: 2px;
    background: var(--red);
    transform: scaleX(0);
    transition: transform .35s var(--ease);
}
.float-field:focus-within .focus-line { transform: scaleX(1); }

.eye {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #9a8b8c;
    cursor: pointer;
    transition: background .2s, color .2s;
}
.eye:hover { background: var(--red-soft); color: var(--red); }
.eye svg { width: 20px; height: 20px; }
.eye .eye-off { display: none; }
.eye.on .eye-open { display: none; }
.eye.on .eye-off { display: block; }

.caps { margin: -6px 0 12px; font-size: 12px; font-weight: 700; color: #8a5a00; background: #fff6e0; border-radius: 8px; padding: 7px 10px; }

.submit {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 54px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    color: #fff;
    font: inherit;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: .2px;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(183, 55, 53, .32);
    transition: transform .2s var(--ease), box-shadow .25s, filter .2s;
}
.submit::before {
    content: "";
    position: absolute;
    top: 0;
    left: -60%;
    width: 50%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent);
    transform: skewX(-20deg);
    transition: left .7s var(--ease);
}
.submit:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(183, 55, 53, .4); }
.submit:hover::before { left: 120%; }
.submit:active { transform: translateY(0) scale(.99); }
.submit:focus-visible { outline: 3px solid rgba(183, 55, 53, .35); outline-offset: 3px; }
.submit .arrow { width: 20px; height: 20px; transition: transform .25s var(--ease); }
.submit:hover .arrow { transform: translateX(5px); }
.submit .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
.submit.loading { pointer-events: none; filter: saturate(.85); }
.submit.loading .arrow { display: none; }
.submit.loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .45);
    transform: scale(0);
    animation: ripple .6s ease-out forwards;
    pointer-events: none;
}
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

.secure-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 18px 0 0;
    font-size: 12px;
    color: var(--muted);
}
.secure-note svg { width: 14px; height: 14px; }

/* Portal do colaborador */
.public { margin-top: 26px; }
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .3px;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.public-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.public-card {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--ink);
    text-decoration: none;
    transition: transform .25s var(--ease), border-color .25s, box-shadow .25s;
}
.public-card:hover { transform: translateY(-3px); border-color: var(--red); box-shadow: 0 12px 26px rgba(183, 55, 53, .13); }
.pc-ico {
    flex: none;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--red-soft);
    color: var(--red);
    transition: background .25s, color .25s, transform .3s var(--ease);
}
.public-card:hover .pc-ico { background: var(--red); color: #fff; transform: rotate(-8deg) scale(1.05); }
.pc-ico svg { width: 19px; height: 19px; }
.public-card strong { display: block; font-size: 14px; }
.public-card small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }

.login-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px 16px;
    max-width: 440px;
    width: 100%;
    margin: 30px auto 0;
    font-size: 12px;
    color: var(--muted);
}
.login-footer a { color: var(--red); font-weight: 800; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; transition: background-size .3s var(--ease); }
.login-footer a:hover { background-size: 100% 1.5px; }

/* Entrada escalonada */
.reveal { opacity: 0; transform: translateY(18px); animation: reveal .7s var(--ease) forwards; animation-delay: calc(var(--d, 0) * 90ms + 80ms); }
@keyframes reveal { to { opacity: 1; transform: none; } }
.login-card.tilting { transition: transform .1s linear, box-shadow .3s; }

/* ---- Responsivo --------------------------------------------------------- */

/* ---- recuperação de senha ---- */
.forgot { margin: -4px 0 12px; text-align: right; font-size: 13px; }
.forgot a, .back-link a { color: var(--red); font-weight: 700; text-decoration: none; position: relative; }
.forgot a::after, .back-link a::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1.5px;
    background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .25s var(--ease);
}
.forgot a:hover::after, .back-link a:hover::after { transform: scaleX(1); transform-origin: left; }
.back-link { margin: 18px 0 0; text-align: center; font-size: 13px; }
.back-link a { display: inline-flex; align-items: center; gap: 6px; }
.back-link svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease); }
.back-link a:hover svg { transform: translateX(-3px); }
a.submit.as-link { text-decoration: none; margin-top: 18px; }
.status-ico {
    display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 16px;
    border-radius: 18px; animation: pop .6s var(--ease) both .25s;
}
.status-ico svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.status-ico.ok { background: #e8f5ed; color: #1e7d46; }
.status-ico.bad { background: var(--red-soft); color: var(--red); }
@keyframes pop { from { transform: scale(.4) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
.hints { margin: 0 0 4px; padding: 0; list-style: none; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.hints li { position: relative; padding: 0 0 8px 22px; }
.hints li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); opacity: .55; }
.strength { display: flex; align-items: center; gap: 10px; margin: -6px 0 14px; }
.strength span { flex: 1; height: 6px; border-radius: 6px; background: #eee5e5; overflow: hidden; position: relative; }
.strength span::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w, 0); background: var(--c, var(--red)); border-radius: 6px; transition: width .3s var(--ease), background .3s; }
.strength small { min-width: 78px; font-size: 12px; font-weight: 700; color: var(--muted); text-align: right; }

@media (max-width: 980px) {
    .shell { grid-template-columns: 1fr; }
    .brand-side { padding: 28px 22px 34px; min-height: auto; }
    .features, .lead, .logo-card { display: none; }
    .headline { margin: 0; font-size: 24px; text-align: center; width: 100%; }
    .brand-content { max-width: none; width: 100%; }
    .ecg { bottom: 0; height: 80px; }
    .form-side { min-height: auto; padding-top: 0; }
    .form-wrap { margin-top: -18px; justify-content: flex-start; }
    .card-logo { display: block; }
}
@media (max-width: 480px) {
    .login-card { padding: 28px 20px 22px; border-radius: 18px; }
    .public-grid { grid-template-columns: 1fr; }
    .login-footer { flex-direction: column; align-items: center; text-align: center; }
    h1 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .reveal { opacity: 1; transform: none; }
    .ecg polyline { stroke-dashoffset: 0; }
}

/* Avisos (sessão expirada, 2FA ativado…) */
.flash-stack { display: grid; gap: 8px; margin-bottom: 14px; }
.flash { border-radius: 12px; padding: 11px 14px; font-size: 14px; line-height: 1.45; background: #eef6f2; border: 1px solid #c7e3d5; color: #1d6b4a; }
.flash-error { background: #fdecec; border-color: #f3c4c4; color: #a12523; }
.flash-info, .flash-warning { background: #fff6e8; border-color: #f0d7a7; color: #6e4b12; }

/* Verificação em duas etapas */
.otp-field input { font-size: 24px; letter-spacing: 6px; font-variant-numeric: tabular-nums; font-weight: 700; }
.otp-help { margin: 16px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; text-align: center; }
.setup-steps { margin: 0 0 14px; padding-left: 22px; font-size: 14px; line-height: 1.5; color: var(--ink); }
.setup-steps li { margin: 4px 0; }
.setup-steps li::marker { color: var(--red); font-weight: 800; }
.qr-box { display: grid; justify-items: center; gap: 10px; padding: 16px; margin: 0 0 16px; border: 1px dashed var(--line); border-radius: 16px; background: #fffafa; }
.qr-box img { display: block; width: 190px; height: 190px; border-radius: 10px; background: #fff; box-shadow: 0 6px 20px rgba(146, 43, 42, .12); }
.manual-key { width: 100%; font-size: 13px; color: var(--muted); }
.manual-key summary { cursor: pointer; text-align: center; color: var(--red); font-weight: 700; }
.manual-key p { margin: 10px 0 8px; line-height: 1.5; }
.manual-key .secret { display: block; text-align: center; font-size: 15px; font-weight: 700; letter-spacing: 1.5px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px; word-break: break-all; user-select: all; }
.copy-btn { display: block; margin: 8px auto 0; border: 1px solid var(--line); background: #fff; color: var(--red); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.setup-card h1 { font-size: 24px; }
