/* Layout de autenticação (login, registro, recuperação de senha, 2FA)
   Fiel ao moneria-app (AuthLayout/RightSide/LoginForm/ui/input/ui/checkbox),
   adaptado pra PHP + Bootstrap5 + Tailwind CDN. Cor de destaque vem de
   --bs-primary / --bs-primary-rgb (dinâmica por whitelabel, ver head-css.php). */

html,
body {
    height: 100%;
}

.auth-shell {
    height: 100vh;
    width: 100%;
    display: flex;
    overflow: hidden;
}

.auth-shell__form {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

@media (min-width: 768px) {
    .auth-shell__form {
        padding: 3rem;
    }
}

@media (min-width: 992px) {
    .auth-shell__form {
        width: 50%;
    }
}

.auth-shell__form-inner {
    width: 100%;
    max-width: 28rem;
    padding-block: 2rem;
}

.auth-shell__decoration {
    display: none;
    position: relative;
    overflow: hidden;
    height: 100%;
    color: #fff;
    background: linear-gradient(145deg, #0b0c12 0%, #15161d 35%, #1e1f27 65%, rgba(var(--bs-primary-rgb), .9) 100%);
}

@media (min-width: 992px) {
    .auth-shell__decoration {
        display: flex;
        width: 50%;
    }
}

/* Blobs orgânicos desfocados — fundo "mesh gradient" suave, sem grid/ruído estruturado */
.auth-shell__blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
}

.auth-shell__blob--a {
    top: -120px;
    left: -100px;
    width: 480px;
    height: 480px;
    background: rgba(var(--bs-primary-rgb), .55);
    opacity: .55;
}

.auth-shell__blob--b {
    bottom: -160px;
    right: -140px;
    width: 520px;
    height: 520px;
    background: rgba(var(--bs-primary-rgb), .4);
    opacity: .4;
}

.auth-shell__blob--c {
    top: 40%;
    right: 10%;
    width: 260px;
    height: 260px;
    background: rgba(255, 255, 255, .12);
    opacity: .5;
    filter: blur(60px);
}

.auth-shell__decoration-content {
    position: relative;
    z-index: 1;
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3.5rem 2.5rem 3rem;
}

.auth-shell__decoration h2 {
    font-size: 2.6rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -.02em;
    margin-bottom: .75rem;
}

.auth-shell__decoration p.auth-decoration-sub {
    font-size: .95rem;
    color: rgba(255, 255, 255, .4);
    margin: 0;
}

/* Mockup de painel flutuante — substitui a lista de pills */
.auth-mockup-wrap {
    position: relative;
    align-self: center;
    width: 100%;
    max-width: 22rem;
    margin: 0 auto;
}

.auth-mockup-card {
    position: relative;
    z-index: 1;
    border-radius: 1.5rem;
    padding: 1.75rem 1.75rem 1.5rem;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .14);
    backdrop-filter: blur(16px);
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .55);
    transform: rotate(-2deg);
}

.auth-mockup-label {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: rgba(255, 255, 255, .5);
    margin-bottom: .35rem;
}

.auth-mockup-value {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.02em;
    margin-bottom: .5rem;
}

.auth-mockup-trend {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .8rem;
    font-weight: 600;
    color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), .16);
    border-radius: 999px;
    padding: .3rem .7rem;
    margin-bottom: 1.25rem;
}

.auth-mockup-sparkline {
    display: flex;
    align-items: flex-end;
    gap: .4rem;
    height: 3.5rem;
}

.auth-mockup-sparkline span {
    flex: 1;
    border-radius: .25rem .25rem 0 0;
    background: rgba(var(--bs-primary-rgb), .35);
}

.auth-mockup-sparkline span:last-child {
    background: var(--bs-primary);
}

.auth-mockup-chip {
    position: absolute;
    z-index: 2;
    top: -1.1rem;
    right: -1.25rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    background: #fff;
    color: #111;
    border-radius: 999px;
    padding: .55rem .9rem;
    font-size: .75rem;
    font-weight: 600;
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, .45);
    transform: rotate(3deg);
}

.auth-mockup-chip i {
    color: var(--bs-primary);
}

/* Cabeçalho (logo + título) */
.auth-header-desktop {
    display: none;
    margin-bottom: 2rem;
}

@media (min-width: 992px) {
    .auth-header-desktop {
        display: block;
    }
}

.auth-header-mobile {
    margin-bottom: 1.5rem;
}

@media (min-width: 992px) {
    .auth-header-mobile {
        display: none;
    }
}

.auth-logo {
    display: inline-block;
    margin-bottom: 1.5rem;
}

.auth-header-mobile .auth-logo {
    margin-bottom: 0;
}

.auth-logo img {
    max-width: 11rem;
    height: auto;
}

.auth-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 .125rem;
}

.auth-subtitle {
    color: #6b7280;
    font-weight: 500;
    font-size: 1rem;
    margin: 0;
}

/* Campos */
.auth-fields {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-field {
    display: flex;
    flex-direction: column;
}

.auth-label {
    font-size: .875rem;
    font-weight: 500;
    color: #0f172a;
    margin: 0 0 .25rem .25rem;
}

.auth-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: .75rem;
    color: #9ca3af;
    pointer-events: none;
    font-size: .875rem;
}

.auth-input {
    width: 100%;
    height: 2.5rem;
    border-radius: .5rem;
    border: 1px solid #e5e7eb;
    background: transparent;
    padding: 0 .75rem;
    font-size: .875rem;
    color: #0f172a;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.auth-input--has-icon {
    padding-left: 2.5rem;
}

.auth-input:focus {
    outline: none;
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), .15);
}

.auth-input.is-invalid {
    border-color: var(--bs-danger);
}

.auth-password-toggle {
    position: absolute;
    right: .75rem;
    border: none;
    background: none;
    cursor: pointer;
    color: #9ca3af;
    display: flex;
    align-items: center;
    transition: color .15s ease;
}

.auth-password-toggle:hover {
    color: var(--bs-primary);
}

.auth-field-error {
    min-height: 1rem;
    font-size: .75rem;
    font-weight: 500;
    color: var(--bs-danger);
    margin: .25rem 0 0 .25rem;
}

/* Checkbox circular */
.auth-checkbox-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 1rem;
}

.auth-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
}

.auth-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    cursor: pointer;
    display: grid;
    place-content: center;
    transition: all .2s ease;
}

.auth-checkbox::before {
    content: "";
    width: .55rem;
    height: .55rem;
    border-radius: 50%;
    transform: scale(0);
    transition: transform .15s ease;
    background: #fff;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.auth-checkbox:checked {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
}

.auth-checkbox:checked::before {
    transform: scale(1.4);
}

.auth-checkbox-text {
    font-size: .875rem;
    font-weight: 500;
    color: #6b7280;
}

.auth-link {
    font-size: .875rem;
    font-weight: 500;
    color: #0f172a;
    text-decoration: none;
}

.auth-link:hover {
    color: var(--bs-primary);
}

/* Botão */
.auth-submit {
    width: 100%;
    height: 3rem;
    border: none;
    border-radius: .75rem;
    background: var(--bs-primary);
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    transition: filter .2s ease, transform .2s ease;
    cursor: pointer;
}

.auth-submit:hover {
    filter: brightness(0.93);
}

/* Variante compacta, lado a lado com outro botão (ex: Voltar/Continuar do wizard) */
.auth-submit--inline {
    width: auto;
    height: auto;
    padding: .65rem 1.5rem;
    border-radius: .65rem;
}

.auth-footer-text {
    text-align: center;
    margin-top: 1.5rem;
    color: #6b7280;
    font-size: 1rem;
}

.auth-footer-text a {
    color: #0f172a;
    font-weight: 500;
    text-decoration: none;
}

.auth-footer-text a:hover {
    color: var(--bs-primary);
}

/* Uniformiza campos do wizard de registro sem reescrever cada um */
.auth-shell input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.auth-shell select,
.auth-shell textarea {
    border-radius: .5rem;
}

.auth-shell input:not([type="checkbox"]):not([type="radio"]):focus,
.auth-shell select:focus,
.auth-shell textarea:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), .15);
}

/* Stepper do wizard de cadastro — nós circulares conectados por linha
   (concluído = check preenchido, atual = anel destacado, futuro = neutro) */
.auth-stepper-nav {
    display: flex;
    align-items: center;
    width: 100%;
}

.auth-step-node {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: .68rem;
    font-weight: 700;
    background: #e5e7eb;
    color: #9ca3af;
    border: 2px solid transparent;
    transition: background .35s ease, border-color .35s ease, box-shadow .35s ease, color .35s ease;
}

.auth-step-node--completed {
    background: var(--bs-primary);
    color: #fff;
    font-size: .75rem;
}

.auth-step-node--current {
    background: #fff;
    border-color: var(--bs-primary);
    color: var(--bs-primary);
    box-shadow: 0 0 0 4px rgba(var(--bs-primary-rgb), .15);
}

.auth-step-connector {
    flex: 1;
    height: 2px;
    min-width: .5rem;
    margin: 0 .2rem;
    background: #e5e7eb;
    transition: background .4s ease;
}

.auth-step-connector--filled {
    background: var(--bs-primary);
}

/* Cards de seleção PF/PJ (substitui o botão pill único) */
.auth-option-stack {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.auth-option-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    text-align: left;
    padding: 1rem 1.25rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 1rem;
    background: #fff;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease;
}

.auth-option-card:hover {
    border-color: #d1d5db;
}

.auth-option-card--active {
    border-color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), .05);
}

.auth-option-card__icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 1.1rem;
    transition: background .2s ease, color .2s ease;
}

.auth-option-card--active .auth-option-card__icon {
    background: var(--bs-primary);
    color: #fff;
}

.auth-option-card__text {
    display: flex;
    flex-direction: column;
}

.auth-option-card__text strong {
    font-size: .95rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: .15rem;
}

.auth-option-card__text span {
    font-size: .8rem;
    color: #6b7280;
}

/* OTP genérico (2FA, validação de código) */
.auth-otp-group {
    display: flex;
    gap: .5rem;
    justify-content: center;
}

.auth-otp-input {
    width: 48px;
    height: 56px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    transition: all .15s ease;
    outline: none;
}

.auth-otp-input:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), .15);
}

.auth-otp-input.filled {
    border-color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), .04);
}

.auth-otp-input.error {
    border-color: var(--bs-danger);
    background: rgba(var(--bs-danger-rgb), .04);
    animation: auth-otp-shake .35s ease;
}

@keyframes auth-otp-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-5px);
    }

    40% {
        transform: translateX(5px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(4px);
    }
}

@media (max-width: 480px) {
    .auth-otp-input {
        width: 42px;
        height: 50px;
        font-size: 1.2rem;
    }
}
