/* FiveDesk V2 — telas auth públicas (reset, 2FA, Google) — fundo alinhado ao login */
:root {
    --blue: #007bff;
    --blue-600: #0061d6;
    --navy: #001f5b;
    --sky: #90eeff;
    --ink: #0d1b34;
    --muted: #64748b;
    --line: #e4e9f0;
    --field: #f6f8fb;
    --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --radius-control: 0.875rem;
    --radius-card: 1rem;
    --radius-lg: 1.25rem;
    --shadow-2: 0 0.75rem 1.875rem -1rem rgba(13, 27, 52, 0.25);
    --shadow-3: 0 2.75rem 6.25rem -2.125rem rgba(0, 12, 40, 0.62);
    --auth-hero:
        radial-gradient(62.5rem 42.5rem at 78% -10%, rgba(0, 123, 255, 0.55), transparent 60%),
        radial-gradient(47.5rem 40rem at -8% 112%, rgba(144, 238, 255, 0.2), transparent 60%),
        linear-gradient(155deg, #001a4d 0%, #002a72 45%, #0046b8 100%);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
}

body {
    font-family: var(--fd-font, var(--font));
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

/* Legado: páginas antigas ainda usam estas classes */
.fd-gradient {
    background: var(--fd-gradient-hero, var(--auth-hero));
}

.fd-dotgrid {
    display: none;
}

.auth-stage {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.75rem;
    position: relative;
    overflow: hidden;
    background: var(--fd-gradient-hero, var(--auth-hero));
    /* Mesmo raio do card de login — não herda o 0.25rem do shell. */
    --fd-radius-card: 1rem;
}

.fd-auth-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.fd-auth-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(3rem);
    pointer-events: none;
}

.fd-auth-blob--a {
    width: 22.5rem;
    height: 22.5rem;
    right: -4.375rem;
    top: 3.75rem;
    background: rgba(0, 123, 255, 0.42);
}

.fd-auth-blob--b {
    width: 18.75rem;
    height: 18.75rem;
    left: -5rem;
    bottom: -2.5rem;
    background: rgba(144, 238, 255, 0.22);
}

.auth-card {
    position: relative;
    z-index: 2;
    width: 28.5rem;
    max-width: 100%;
    background: var(--fd-surface, #fff);
    border-radius: 1rem;
    box-shadow: var(--fd-shadow-3, var(--shadow-3));
    border: 0.0625rem solid color-mix(in srgb, var(--fd-border, #d8e0ec) 65%, transparent);
    padding: 2.75rem 2.5rem 2.25rem;
    text-align: center;
}

.auth-card.wide {
    width: 31.25rem;
}

.auth-card .logo {
    height: 2.5rem;
    width: auto;
    margin: 0 auto 1.25rem;
}

.auth-card h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03125rem;
    margin: 0 0 0.5rem;
    color: var(--fd-text, var(--ink));
    line-height: 1.25;
}

.auth-card > p,
.auth-card .auth-lead,
.auth-card .lead {
    font-size: 0.9375rem;
    color: var(--fd-text-muted, var(--muted));
    margin: 0 0 0.75rem;
    line-height: 1.55;
}

.auth-lead-sub {
    font-size: 0.875rem;
    color: var(--fd-text-muted, var(--muted));
    margin: 0 0 1.375rem;
    line-height: 1.55;
}

.auth-card p .em,
.auth-lead .em {
    color: var(--fd-text, var(--ink));
    font-weight: 700;
}

.auth-step-label {
    margin: -0.875rem auto 1.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #8a97ad;
}

.auth-step-label--left {
    margin-left: 0;
    text-align: left;
}

.auth-actions-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.375rem 0.625rem;
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    color: var(--muted);
}

.auth-actions-label {
    font-weight: 500;
}

.auth-link-btn {
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--blue);
    background: none;
    border: 0;
    cursor: pointer;
    padding: 0;
}

.auth-link-btn:disabled {
    color: #9aa7bd;
    cursor: default;
}

.auth-link-btn:not(:disabled):hover {
    text-decoration: underline;
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    margin-top: 1.375rem;
}

.auth-back:hover {
    color: var(--ink);
}

.auth-back svg {
    width: 1rem;
    height: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5625rem;
    height: 2.875rem;
    padding: 0 1.375rem;
    border: 0;
    border-radius: var(--radius-control);
    font-family: inherit;
    font-size: 0.90625rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: 0.18s;
    white-space: nowrap;
    margin-top: 0.25rem;
}

.ok-wrap .btn {
    margin-top: 1.5rem;
}

.btn.primary {
    color: #fff;
    background: linear-gradient(135deg, #007bff, #0052cc);
    box-shadow: 0 0.75rem 1.625rem -0.75rem rgba(0, 90, 220, 0.7);
}

.btn.primary:hover:not(:disabled) {
    transform: translateY(-0.0625rem);
}

.btn.primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn.lg {
    height: 3.25rem;
    padding: 0 1.75rem;
    font-size: 0.96875rem;
}

.btn.block {
    width: 100%;
}

.auth-pending {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #374863;
    background: var(--field);
    border: 0.0625rem solid var(--line);
    border-radius: var(--radius-control);
    padding: 0.75rem 0.875rem;
    margin: 1rem 0 0;
    text-align: left;
}

.auth-pending[hidden] {
    display: none;
}

.auth-pending.is-error {
    color: #9f1239;
    background: #fff1f2;
    border-color: #fecdd3;
}

.auth-pending strong {
    color: var(--ink);
}

.steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
}

.steps .s {
    width: 1.875rem;
    height: 0.3125rem;
    border-radius: 0.3125rem;
    background: var(--line);
}

.steps .s.done {
    background: var(--blue);
}

.shield {
    width: 4.875rem;
    height: 4.875rem;
    margin: 0 auto 1.375rem;
    border-radius: 50%;
    background: rgba(0, 123, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blue);
}

.shield svg {
    width: 2.375rem;
    height: 2.375rem;
}

.otp {
    display: flex;
    gap: 0.625rem;
    justify-content: center;
    margin: 0.375rem 0 0.25rem;
}

.otp input {
    width: 3.625rem;
    height: 4.125rem;
    text-align: center;
    font-family: inherit;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--ink);
    border: 0.09375rem solid var(--line);
    border-radius: 0.875rem;
    background: var(--field);
    outline: none;
    transition: 0.15s;
    -moz-appearance: textfield;
}

.otp input::-webkit-outer-spin-button,
.otp input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.otp input:focus {
    border-color: var(--blue);
    background: #fff;
    box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.13);
}

.otp input.filled {
    border-color: #bcd4f5;
    background: #fff;
}

.otp.invalid input {
    border-color: #e5484d;
    background: #fff5f5;
    animation: auth-shake 0.4s;
}

@keyframes auth-shake {
    0%,
    100% {
        transform: translateX(0);
    }
    20%,
    60% {
        transform: translateX(-0.375rem);
    }
    40%,
    80% {
        transform: translateX(0.375rem);
    }
}

.err-msg {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.4375rem;
    color: #e5484d;
    font-size: 0.8125rem;
    font-weight: 600;
    margin: 0.875rem 0 0;
}

.err-msg.show {
    display: flex;
}

.err-msg svg {
    width: 0.9375rem;
    height: 0.9375rem;
}

.err-msg--warn {
    color: #b4790a;
}

.trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5625rem;
    margin: 1.375rem 0 0.125rem;
    font-size: 0.84375rem;
    color: #3c4a63;
    cursor: pointer;
    user-select: none;
}

.trust input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.trust .box {
    width: 1.1875rem;
    height: 1.1875rem;
    border: 0.1rem solid #c6d0e0;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.15s;
    background: #fff;
}

.trust input:checked + .box {
    background: var(--blue);
    border-color: var(--blue);
}

.trust .box svg {
    width: 0.75rem;
    height: 0.75rem;
    color: #fff;
    opacity: 0;
}

.trust input:checked + .box svg {
    opacity: 1;
}

.resend {
    font-size: 0.8125rem;
    color: var(--muted);
    margin-top: 0.5rem;
}

.resend button {
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--blue);
    background: none;
    border: 0;
    cursor: pointer;
    padding: 0;
}

.resend button:disabled {
    color: #9aa7bd;
    cursor: default;
}

.resend button:not(:disabled):hover {
    text-decoration: underline;
}

.alt {
    margin-top: 1.125rem;
    padding-top: 1.125rem;
    border-top: 0.0625rem solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.alt .swap {
    font-size: 0.84375rem;
    font-weight: 600;
    color: var(--blue);
    text-decoration: none;
    background: none;
    border: 0;
    cursor: pointer;
    font-family: inherit;
}

.alt .swap:hover {
    text-decoration: underline;
}

.gconnect {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.125rem;
    margin: 0 auto 1.625rem;
}

.gconnect .node {
    width: 3.875rem;
    height: 3.875rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-2);
    background: #fff;
    border: 0.0625rem solid var(--line);
}

.gconnect .node.fd {
    background: #001a4d;
    border-color: #001a4d;
}

.gconnect .node svg {
    width: 1.875rem;
    height: 1.875rem;
}

.gconnect .link {
    display: flex;
    gap: 0.3125rem;
}

.gconnect .link i {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 50%;
    background: var(--blue);
    display: block;
    animation: fd-pulse 1.2s ease-in-out infinite;
}

.gconnect .link i:nth-child(2) {
    animation-delay: 0.2s;
}

.gconnect .link i:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes fd-pulse {
    0%,
    100% {
        opacity: 0.25;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

.spinner {
    width: 2.875rem;
    height: 2.875rem;
    margin: 0 auto 1.5rem;
    border: 0.25rem solid var(--field);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: fd-spin 0.8s linear infinite;
}

.spinner[hidden] {
    display: none;
}

@keyframes fd-spin {
    to {
        transform: rotate(360deg);
    }
}

.secure {
    display: inline-flex;
    align-items: center;
    gap: 0.4375rem;
    font-size: 0.78125rem;
    color: var(--muted);
    margin-top: 0.25rem;
}

.secure svg {
    width: 0.875rem;
    height: 0.875rem;
}

.auth-divider {
    border-top: 0.0625rem solid var(--line);
    margin-top: 1.5rem;
    padding-top: 1.125rem;
}

.auth-divider--start {
    text-align: left;
}

.auth-divider--start .auth-back {
    margin-top: 0;
}

.envelope {
    width: 4.25rem;
    height: 4.25rem;
    margin: 0 auto 1.25rem;
    border-radius: 1.125rem;
    background: color-mix(in srgb, var(--blue) 9%, #fff);
    border: 0.0625rem solid color-mix(in srgb, var(--blue) 18%, var(--line));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blue);
    box-shadow: 0 0.5rem 1.25rem -0.75rem rgba(0, 90, 220, 0.45);
}

.envelope svg {
    width: 2rem;
    height: 2rem;
}

.auth-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: var(--field);
    border: 0.0625rem solid var(--line);
    border-radius: var(--radius-control);
    padding: 0.875rem 1rem;
    font-size: 0.8125rem;
    color: #5b6a86;
    margin-top: 1.375rem;
    line-height: 1.5;
    text-align: left;
}

.auth-tip-icon {
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.0625rem;
    color: var(--blue);
}

.auth-tip-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.auth-tip-body {
    display: flex;
    flex-direction: column;
    gap: 0.1875rem;
    min-width: 0;
}

.auth-tip-body strong {
    color: var(--ink);
    font-size: 0.8125rem;
    font-weight: 700;
}

.auth-strength-panel {
    background: var(--field);
    border: 0.0625rem solid var(--line);
    border-radius: var(--radius-control);
    padding: 0.875rem 1rem 1rem;
    margin: 0 0 1.125rem;
}

.auth-pending--block {
    text-align: left;
    margin-top: 0.5rem;
}

.auth-card--left {
    text-align: left;
}

.auth-card--left .logo--left {
    margin: 0 0 1.5rem;
}

.auth-card--left h1.text-left,
.auth-card--left p.lead.text-left {
    text-align: left;
}

.steps--left {
    justify-content: flex-start;
}

.pf {
    margin-bottom: 1rem;
}

.pf label {
    display: block;
    font-size: 0.84375rem;
    font-weight: 600;
    margin-bottom: 0.4375rem;
    color: #243a5e;
}

.pf .ctrl {
    position: relative;
}

.pf input {
    width: 100%;
    height: 3.125rem;
    border: 0.09375rem solid var(--line);
    border-radius: var(--radius-control);
    background: var(--field);
    padding: 0 2.875rem 0 0.9375rem;
    font-family: ui-monospace, 'Cascadia Mono', 'Segoe UI Mono', Consolas, monospace;
    font-size: 0.90625rem;
    letter-spacing: 0.02em;
    color: var(--ink);
    outline: none;
    transition: 0.15s;
    box-sizing: border-box;
}

.pf input:focus {
    border-color: var(--blue);
    background: #fff;
    box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.13);
}

.pf input::placeholder {
    color: #9aa7bd;
}

.pf .eye {
    position: absolute;
    right: 0.4375rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2.375rem;
    height: 2.375rem;
    border: 0;
    background: transparent;
    cursor: pointer;
    color: #8190aa;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5625rem;
}

.pf .eye:hover {
    background: #eef2f8;
    color: var(--blue);
}

.pf .eye svg {
    width: 1.25rem;
    height: 1.25rem;
}

.pf.bad input {
    border-color: #e5484d;
    background: #fff5f5;
}

.pf .hint {
    display: none;
    font-size: 0.78125rem;
    color: #e5484d;
    font-weight: 600;
    margin-top: 0.375rem;
}

.pf.bad .hint {
    display: block;
}

.pf.ok input {
    border-color: #bfe6cf;
}

.strength {
    display: flex;
    gap: 0.375rem;
    margin: 0.375rem 0 0.875rem;
}

.strength i {
    flex: 1;
    height: 0.375rem;
    border-radius: 0.3125rem;
    background: #dde3ee;
    transition: 0.2s;
    font-style: normal;
}

.strength.l1 i:nth-child(1) {
    background: #e5484d;
}

.strength.l2 i:nth-child(-n + 2) {
    background: #e0a106;
}

.strength.l3 i:nth-child(-n + 3) {
    background: #2f9bff;
}

.strength.l4 i {
    background: #1f9d57;
}

.strength-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--muted);
    margin: 0;
}

.strength-label b {
    color: var(--ink);
}

.auth-strength-panel .reqs {
    margin: 0;
}

.reqs {
    list-style: none;
    margin: 0 0 1.375rem;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5625rem 0.875rem;
}

.reqs li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78125rem;
    color: var(--muted);
    transition: 0.15s;
}

.reqs li .tick {
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 50%;
    border: 0.1rem solid #d2dae8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    transition: 0.15s;
}

.reqs li .tick svg {
    width: 0.6875rem;
    height: 0.6875rem;
    color: #fff;
    opacity: 0;
}

.reqs li.met {
    color: #15703f;
}

.reqs li.met .tick {
    background: #1f9d57;
    border-color: #1f9d57;
}

.reqs li.met .tick svg {
    opacity: 1;
}

.ok-wrap {
    display: none;
    text-align: center;
}

.ok-wrap.show {
    display: block;
    animation: authFadeIn 0.35s ease;
}

@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: translateY(0.5rem);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.ok-circle {
    width: 5.25rem;
    height: 5.25rem;
    margin: 0.375rem auto 1.5rem;
    border-radius: 50%;
    background: #e8f7ef;
    color: #1f9d57;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: authPopIn 0.4s ease;
}

@keyframes authPopIn {
    0% {
        transform: scale(0.6);
        opacity: 0;
    }
    60% {
        transform: scale(1.08);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.ok-circle svg {
    width: 2.625rem;
    height: 2.625rem;
}

.auth-invalid {
    text-align: center;
}

.auth-invalid-icon {
    width: 4.5rem;
    height: 4.5rem;
    margin: 0.75rem auto 1.25rem;
    border-radius: 50%;
    background: #fff5f5;
    color: #e5484d;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-invalid-icon svg {
    width: 2.25rem;
    height: 2.25rem;
}

@media (max-width: 520px) {
    .auth-card {
        padding: 2.25rem 1.5rem 2rem;
    }

    .otp {
        gap: 0.375rem;
    }

    .otp input {
        width: 2.75rem;
        height: 3.5rem;
        font-size: 1.375rem;
    }
}

/* ==========================================================================
   V2 Sprint 13 — Auth auxiliar QA (2FA/reset/Google placeholder)
   Cache: fivedesk-auth-v2-s13
   ========================================================================== */

.auth-stage {
    overflow-x: clip;
}

.auth-card input:focus-visible,
.auth-card textarea:focus-visible,
.auth-card select:focus-visible,
.auth-card .eye:focus-visible {
    outline: none;
    box-shadow: var(--fd-focus-ring);
}

.btn.primary:focus-visible,
.btn.ghost:focus-visible,
.auth-back:focus-visible,
.otp input:focus-visible,
#resendBtn:focus-visible,
#verifyBtn:focus-visible,
#resetBtn:focus-visible {
    outline: none;
    box-shadow: var(--fd-focus-ring);
}

.btn.primary:disabled,
.btn.ghost:disabled,
#verifyBtn:disabled,
#resetBtn:disabled,
#resendBtn:disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.auth-pending,
#resetPendingMsg,
#pendingMsg,
.err-msg {
    line-height: 1.45;
}

@media (max-width: 480px) {
    .auth-card input,
    .auth-card select,
    .auth-card textarea {
        font-size: 1rem;
    }

    .btn.primary.block,
    .btn.ghost.block {
        min-height: 3rem;
    }
}
