/* =========================================================
   AUTH - IGREJA PENTECOSTAL PROVIDÊNCIA DIVINA
   ========================================================= */

.auth-page {
    position: relative;
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 32px 20px;
    background:
        radial-gradient(
            circle at 50% 20%,
            rgba(74, 117, 180, 0.13) 0%,
            transparent 36%
        ),
        radial-gradient(
            circle at 15% 90%,
            rgba(36, 80, 140, 0.08) 0%,
            transparent 38%
        ),
        var(--background);

    overflow: hidden;
    isolation: isolate;
}


/* =========================================================
   LUZ DECORATIVA
   ========================================================= */

.auth-page::before {
    content: "";
    position: absolute;
    width: 600px;
    height: 600px;
    top: -330px;
    left: 50%;
    transform: translateX(-50%);

    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.16),
        rgba(80, 125, 190, 0.05) 45%,
        transparent 70%
    );

    border-radius: 50%;
    filter: blur(10px);
    pointer-events: none;
    z-index: -3;
}


/* =========================================================
   CRUZ DECORATIVA NO FUNDO
   ========================================================= */

.auth-background-cross {
    position: absolute;
    top: 9%;
    left: 50%;

    width: 2px;
    height: 210px;

    transform: translateX(-50%);

    background: linear-gradient(
        to bottom,
        transparent,
        rgba(93, 130, 180, 0.12),
        rgba(93, 130, 180, 0.06),
        transparent
    );

    pointer-events: none;
    z-index: -2;
}

.auth-background-cross::after {
    content: "";
    position: absolute;

    width: 105px;
    height: 2px;

    left: 50%;
    top: 60px;

    transform: translateX(-50%);

    background: linear-gradient(
        to right,
        transparent,
        rgba(93, 130, 180, 0.12),
        transparent
    );
}


/* =========================================================
   DETALHES DE FUNDO
   ========================================================= */

.auth-decoration {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(105, 135, 175, 0.08);

    pointer-events: none;
    z-index: -2;

    animation: authFloat 9s ease-in-out infinite;
}

.auth-decoration-one {
    width: 340px;
    height: 340px;

    left: -170px;
    bottom: -120px;
}

.auth-decoration-two {
    width: 220px;
    height: 220px;

    right: -100px;
    top: 80px;

    animation-delay: -3s;
}


/* =========================================================
   PAINEL
   ========================================================= */

.auth-panel {
    position: relative;

    width: min(100%, 430px);

    padding: 42px 38px 36px;

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.025),
            transparent
        ),
        var(--surface);

    border: 1px solid var(--border);
    border-radius: calc(var(--border-radius) + 8px);

    text-align: center;

    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.12),
        0 8px 25px rgba(0, 0, 0, 0.06);

    animation: authPanelEnter 0.75s cubic-bezier(0.22, 1, 0.36, 1);

    overflow: hidden;
}


/* pequena luz na parte superior */

.auth-panel::before {
    content: "";

    position: absolute;

    top: 0;
    left: 12%;
    right: 12%;

    height: 1px;

    background: linear-gradient(
        to right,
        transparent,
        rgba(120, 155, 205, 0.55),
        transparent
    );
}


/* efeito de luz interno */

.auth-panel::after {
    content: "";

    position: absolute;

    width: 180px;
    height: 180px;

    top: -130px;
    left: 50%;

    transform: translateX(-50%);

    border-radius: 50%;

    background: rgba(99, 142, 200, 0.09);

    filter: blur(32px);

    pointer-events: none;
}


/* =========================================================
   LOGO
   ========================================================= */

.auth-logo-container {
    position: relative;

    display: flex;
    justify-content: center;
    align-items: center;

    width: 128px;
    height: 128px;

    margin: 0 auto 20px;

    border-radius: 50%;

    background: linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.08),
        rgba(255, 255, 255, 0.01)
    );

    border: 1px solid rgba(110, 145, 190, 0.13);

    box-shadow:
        0 14px 35px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);

    animation: authLogoEnter 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}


.auth-logo-container::before {
    content: "";

    position: absolute;

    inset: 8px;

    border-radius: inherit;

    border: 1px solid rgba(110, 145, 190, 0.07);
}


.auth-logo {
    position: relative;

    width: 86px;
    height: auto;

    margin: 0;

    z-index: 1;

    transition:
        transform 0.4s ease,
        filter 0.4s ease;
}


.auth-logo-container:hover .auth-logo {
    transform: scale(1.04);
}


/* =========================================================
   TÍTULO
   ========================================================= */

.auth-panel h1 {
    position: relative;

    margin: 0 auto 10px;

    max-width: 350px;

    font-size: clamp(1.55rem, 4vw, 1.85rem);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.025em;

    color: var(--text-primary);
}


.auth-panel > p {
    margin: 0 auto 28px;

    color: var(--text-secondary);

    font-size: 0.95rem;
    line-height: 1.55;
}


/* =========================================================
   DIVISOR
   ========================================================= */

.auth-divider {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 12px;

    margin: 4px 0 27px;
}


.auth-divider::before,
.auth-divider::after {
    content: "";

    width: 45px;
    height: 1px;

    background: linear-gradient(
        to right,
        transparent,
        var(--border)
    );
}


.auth-divider::after {
    background: linear-gradient(
        to left,
        transparent,
        var(--border)
    );
}


.auth-divider-symbol {
    width: 5px;
    height: 5px;

    border-radius: 50%;

    background: var(--text-secondary);

    opacity: 0.4;
}


/* =========================================================
   FORMULÁRIO
   ========================================================= */

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


.form-group {
    position: relative;

    margin-bottom: 19px;
}


.auth-panel .form-group label {
    display: block;

    margin-bottom: 7px;

    font-size: 0.84rem;
    font-weight: 600;

    color: var(--text-primary);

    letter-spacing: 0.01em;
}


/* Inputs vindos do Django */

.auth-panel input[type="text"],
.auth-panel input[type="password"],
.auth-panel input[type="email"] {
    width: 100%;

    min-height: 48px;

    padding: 0 14px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--background);

    color: var(--text-primary);

    font-size: 0.95rem;

    outline: none;

    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.25s ease,
        background 0.25s ease;
}


.auth-panel input:hover {
    border-color: rgba(100, 135, 185, 0.4);
}


.auth-panel input:focus {
    border-color: rgba(70, 115, 180, 0.75);

    box-shadow:
        0 0 0 4px rgba(70, 115, 180, 0.09),
        0 7px 18px rgba(0, 0, 0, 0.04);

    transform: translateY(-1px);
}


/* =========================================================
   CAMPO SENHA
   ========================================================= */

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    width: 100%;
    padding-right: 48px;
}

.password-toggle {
    position: absolute;

    top: 50%;
    right: 12px;

    transform: translateY(-50%);

    z-index: 5;

    display: grid;

    width: 34px;
    height: 34px;

    place-items: center;

    border: 0;

    padding: 0;

    background: transparent;

    color: var(--text-secondary);

    cursor: pointer;
}

.password-toggle svg {
    width: 19px;
    height: 19px;

    fill: none;
    stroke: currentColor;

    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;

    pointer-events: none;
}

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

.password-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;

    border-radius: 6px;
}

/* =========================================================
   BOTÃO
   ========================================================= */

.auth-panel .button-primary {
    position: relative;

    width: 100%;
    min-height: 50px;

    margin-top: 6px;

    border: none;
    border-radius: 11px;

    overflow: hidden;

    font-size: 0.95rem;
    font-weight: 600;

    cursor: pointer;

    box-shadow:
        0 10px 22px rgba(0, 0, 0, 0.10);

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        filter 0.25s ease;
}


.auth-panel .button-primary::before {
    content: "";

    position: absolute;

    top: 0;
    left: -150%;

    width: 80%;
    height: 100%;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.18),
        transparent
    );

    transform: skewX(-20deg);

    transition: left 0.7s ease;
}


.auth-panel .button-primary:hover::before {
    left: 140%;
}


.auth-panel .button-primary:hover {
    transform: translateY(-2px);

    box-shadow:
        0 14px 30px rgba(0, 0, 0, 0.15);
}


.auth-panel .button-primary:active {
    transform: translateY(0);
}


/* =========================================================
   ERROS
   ========================================================= */

.form-errors {
    position: relative;

    margin-bottom: 20px;
    padding: 12px 14px;

    border-radius: 9px;

    text-align: left;

    font-size: 0.88rem;
    line-height: 1.45;

    animation: authShake 0.4s ease;
}


/* =========================================================
   RODAPÉ
   ========================================================= */

.auth-footer {
    margin-top: 28px;

    padding-top: 20px;

    border-top: 1px solid var(--border);

    color: var(--text-secondary);

    font-size: 0.75rem;
    line-height: 1.6;

    opacity: 0.75;
}


.auth-footer strong {
    display: block;

    color: var(--text-primary);

    font-size: 0.77rem;
    font-weight: 500;

    margin-bottom: 2px;
}


/* =========================================================
   LOADING DO BOTÃO
   ========================================================= */

.button-primary.is-loading {
    pointer-events: none;
    opacity: 0.88;
}


.button-primary.is-loading .button-text {
    opacity: 0;
}


.button-loader {
    display: none;

    position: absolute;

    width: 19px;
    height: 19px;

    top: 50%;
    left: 50%;

    margin-top: -9.5px;
    margin-left: -9.5px;

    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;

    border-radius: 50%;

    animation: authSpin 0.7s linear infinite;
}


.button-primary.is-loading .button-loader {
    display: block;
}


/* =========================================================
   ANIMAÇÕES
   ========================================================= */

@keyframes authPanelEnter {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.985);
        filter: blur(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}


@keyframes authLogoEnter {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.92);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


@keyframes authFloat {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
}


@keyframes authSpin {
    to {
        transform: rotate(360deg);
    }
}


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

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

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


/* =========================================================
   RESPONSIVIDADE
   ========================================================= */

@media (max-width: 520px) {

    .auth-page {
        padding: 20px 15px;
    }

    .auth-panel {
        padding: 34px 24px 28px;

        border-radius: calc(var(--border-radius) + 4px);
    }

    .auth-logo-container {
        width: 110px;
        height: 110px;
    }

    .auth-logo {
        width: 74px;
    }

    .auth-panel h1 {
        font-size: 1.5rem;
    }
}


/* =========================================================
   ACESSIBILIDADE
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .auth-panel,
    .auth-logo-container,
    .auth-decoration,
    .form-errors,
    .button-loader {
        animation: none;
    }

    .auth-panel *,
    .auth-logo {
        transition: none;
    }
}

.password-toggle svg {
    width: 19px;
    height: 19px;

    display: block;

    stroke: currentColor;
    fill: none;

    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;

    pointer-events: none;
}


.password-toggle:focus-visible {
    outline: 2px solid rgba(70, 115, 180, 0.55);
    outline-offset: 2px;
}