.auth {
    position: relative;
    overflow: hidden;
    background-color: #e7e7e7;
}

.bg-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    max-width: 95vw;
    opacity: 0.08;
    z-index: 0;
    pointer-events: none;
    user-select: none;
}

.middle-wave {
    position: absolute;
    top: 50%;
    left: 0;
    width: 200%;
    height: 100px;
    transform: translateY(-50%);
    background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 1000 100" xmlns="http://www.w3.org/2000/svg"><path fill="none" stroke="%2385c83b" stroke-width="3" stroke-opacity="0.3" d="M0,50 C250,150 250,-50 500,50 C750,150 750,-50 1000,50"></path></svg>') repeat-x;
    background-size: 1000px 100px;
    animation: waveMiddle 20s linear infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes waveMiddle {
    0% {
        transform: translateY(-50%) translateX(0);
    }

    100% {
        transform: translateY(-50%) translateX(-1000px);
    }
}

.floating-icons {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.f-icon {
    position: absolute;
    color: rgba(133, 200, 59, 0.25);
    font-size: 60px;
    animation: floatIcon 12s ease-in-out infinite alternate;
}

.f-icon-1 {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
    font-size: 90px;
}

.f-icon-2 {
    top: 70%;
    left: 15%;
    animation-delay: -2s;
    font-size: 70px;
}

.f-icon-3 {
    top: 15%;
    right: 15%;
    animation-delay: -5s;
    font-size: 80px;
}

.f-icon-4 {
    top: 70%;
    right: 10%;
    animation-delay: -7s;
    font-size: 65px;
}

.f-icon-5 {
    top: 45%;
    left: 85%;
    animation-delay: -3s;
    font-size: 50px;
}

@keyframes floatIcon {
    0% {
        transform: translateY(0) rotate(0deg);
    }

    100% {
        transform: translateY(30px) rotate(15deg);
    }
}

/* Modal Personalizado Premium */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.15);
    /* Menos blanco */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.custom-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.custom-modal-content {
    background: #ffffff;
    width: 90%;
    max-width: 420px;
    border-radius: 10px;
    /* Igual que la card */
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
    transform: scale(0.85);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.custom-modal-overlay.active .custom-modal-content {
    transform: scale(1);
}

.custom-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 10;
}

.custom-modal-close:hover {
    color: #333;
}

.modal-inner-padding {
    padding: 35px 40px;
    position: relative;
    z-index: 1;
}

.modal-top-glow {
    position: absolute;
    top: -40px;
    left: -10%;
    width: 120%;
    height: 120px;
    background: linear-gradient(90deg, rgba(85, 153, 34, 0.3) 0%, rgba(133, 200, 59, 0.35) 50%, rgba(166, 219, 108, 0.3) 100%);
    filter: blur(40px);
    z-index: 0;
    pointer-events: none;
}

.auth-container {
    border-radius: 10px;
}

.glow-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    z-index: 0;
    animation: floatGlow 8s ease-in-out infinite alternate;
}

.glow-1 {
    width: 350px;
    height: 350px;
    background: #85c83b;
    top: -150px;
    left: -150px;
}

.glow-2 {
    width: 450px;
    height: 450px;
    background: #a6db6c;
    top: -200px;
    right: -200px;
    animation-delay: -4s;
}

@keyframes floatGlow {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(50px, 50px) scale(1.1);
    }
}

.auth-container {
    position: relative;
    z-index: 1;
}

.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper .input-icon {
    position: absolute;
    left: 5px;
    top: 12px;
    color: #999;
    z-index: 2;
}

.input-icon-wrapper input.form-control {
    padding-left: 30px !important;
}

.input-icon-wrapper input.form-control.error,
.input-icon-wrapper input.form-control.error:focus {
    border-color: #ff4444 !important;
}

.card {
    background: rgba(255, 255, 255, 0.637);

    backdrop-filter: blur(80px) saturate(140%);
    -webkit-backdrop-filter: blur(80px) saturate(140%);

    border: 1px solid rgba(255, 255, 255, 0.25);

    border-radius: 10px;
}

.auth-header img {
    padding: 5px;
    width: 150px;
    margin: 0 auto;
}

.send-code-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    overflow: hidden;
}

.send-code-button__icon,
.send-code-button__plane,
.send-code-button__plane svg,
.send-code-button__label {
    display: block;
}

.send-code-button__plane svg {
    transform-origin: center;
}

.send-code-button__label {
    transition: opacity .16s ease, transform .22s ease;
}

.send-code-button.is-sending .send-code-button__label {
    opacity: 0;
    transform: translateX(45px);
}

.send-code-button.is-sending .send-code-button__icon {
    animation: sendPlaneLaunch 1.3s cubic-bezier(.42, 0, .3, 1) infinite !important;
}

@keyframes sendPlaneLaunch {
    0% { opacity: 1; transform: translate(0, 0) rotate(0) scale(1); }
    18% { opacity: 1; transform: translate(5px, 0) rotate(8deg) scale(1.06); }
    64% { opacity: 1; transform: translate(78px, 0) rotate(12deg) scale(1.12); }
    79% { opacity: 0; transform: translate(118px, 0) rotate(12deg) scale(.92); }
    80% { opacity: 0; transform: translate(-52px, 0) rotate(8deg) scale(.82); }
    100% { opacity: 1; transform: translate(0, 0) rotate(0) scale(1); }
}

.password-success {
    position: relative;
    padding: 22px 0 14px;
    text-align: center;
}

.password-success__icon {
    position: relative;
    z-index: 2;
    display: flex;
    width: 82px;
    height: 82px;
    margin: 0 auto 22px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #85c83b;
    color: #fff;
    box-shadow: 0 12px 30px rgba(133, 200, 59, .42);
    font-size: 38px;
    transform: scale(0);
    animation: successSurprise .65s cubic-bezier(.17, .89, .32, 1.49) forwards;
}

.password-success__icon::before,
.password-success__icon::after {
    content: '';
    position: absolute;
    inset: -2px;
    border: 3px solid rgba(133, 200, 59, .65);
    border-radius: 50%;
    opacity: 0;
    animation: successRing .85s ease-out .18s forwards;
}

.password-success__icon::after {
    animation-delay: .34s;
}

.password-success__icon i {
    opacity: 0;
    transform: scale(.35) rotate(-18deg);
    animation: successCheck .34s cubic-bezier(.2, .9, .35, 1.5) .36s forwards;
}

.password-success__confetti {
    position: absolute;
    z-index: 1;
    top: 63px;
    left: 50%;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.password-success__confetti span {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: #85c83b;
    opacity: 0;
    animation: successConfetti .75s cubic-bezier(.1, .7, .35, 1) .28s forwards;
}

.password-success__confetti span:nth-child(2n) { background: #ffd45a; }
.password-success__confetti span:nth-child(3n) { background: #5eaa22; border-radius: 50%; }
.password-success__confetti span:nth-child(1) { --x: -76px; --y: -38px; --r: -80deg; }
.password-success__confetti span:nth-child(2) { --x: -42px; --y: -70px; --r: 45deg; }
.password-success__confetti span:nth-child(3) { --x: 2px; --y: -82px; --r: 110deg; }
.password-success__confetti span:nth-child(4) { --x: 48px; --y: -65px; --r: 170deg; }
.password-success__confetti span:nth-child(5) { --x: 78px; --y: -25px; --r: 240deg; }
.password-success__confetti span:nth-child(6) { --x: 68px; --y: 35px; --r: 300deg; }
.password-success__confetti span:nth-child(7) { --x: -62px; --y: 38px; --r: -210deg; }
.password-success__confetti span:nth-child(8) { --x: -86px; --y: 6px; --r: -150deg; }

.password-success p {
    margin: 0;
    color: #36402f;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    opacity: 0;
    transform: translateY(8px);
    animation: successMessage .45s cubic-bezier(.2, .8, .3, 1.2) .42s forwards;
}

@keyframes successSurprise {
    0% { transform: scale(0) rotate(-20deg); }
    55% { transform: scale(1.22) rotate(6deg); }
    75% { transform: scale(.92) rotate(-2deg); }
    100% { transform: scale(1) rotate(0); }
}

@keyframes successCheck {
    to { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes successRing {
    0% { opacity: .9; transform: scale(.82); }
    100% { opacity: 0; transform: scale(1.75); }
}

@keyframes successConfetti {
    0% { opacity: 0; transform: translate(0, 0) scale(.2) rotate(0); }
    20% { opacity: 1; }
    100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(1) rotate(var(--r)); }
}

@keyframes successMessage {
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .password-success__icon,
    .password-success__icon i,
    .password-success p {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .password-success__icon::before,
    .password-success__icon::after,
    .password-success__confetti {
        display: none;
    }
}
