@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700;800&display=swap');

/* Loader overlay */
.dalex-loader-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;

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

    background: rgba(248, 251, 255, 0.88);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);

    opacity: 1;
    visibility: visible;

    transition:
        opacity 0.35s ease,
        visibility 0.35s ease;
    
    font-family: Inter, Arial, sans-serif;
}

.dalex-loader-overlay.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Loader container */
.dalex-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;

    min-width: 460px;
    padding: 30px 38px;

    background: rgba(255, 255, 255, 0.94);
    border: 1px solid #e5edf7;
    border-radius: 24px;

    box-shadow:
        0 22px 65px rgba(15, 61, 110, 0.12),
        0 5px 18px rgba(15, 61, 110, 0.06);
}

/* Loader icon */
.dalex-loader-icon {
    position: relative;

    width: 122px;
    height: 122px;

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

    flex-shrink: 0;
}

/* Rotating segmented ring */
.dalex-loader-ring {
    position: absolute;
    inset: 0;

    border-radius: 50%;

    background: repeating-conic-gradient(
        from 0deg,
        #0d4f91 0deg 16deg,
        transparent 16deg 24deg,
        #83bdf2 24deg 40deg,
        transparent 40deg 48deg
    );

    animation: dalexRotate 1.25s linear infinite;

    filter: drop-shadow(0 5px 10px rgba(30, 117, 196, 0.15));
}

/* Cut out the center of the ring */
.dalex-loader-ring::after {
    content: "";
    position: absolute;
    inset: 14px;

    border-radius: 50%;
    background: #ffffff;
}

/* Subtle pulse behind logo */
.dalex-loader-pulse {
    position: absolute;
    width: 76px;
    height: 76px;

    border-radius: 50%;
    background: rgba(66, 153, 225, 0.1);

    animation: dalexPulse 1.8s ease-in-out infinite;
}

/* Stable roof logo */
.dalex-roof-logo {
    position: relative;
    z-index: 3;

    width: 66px;
    height: 66px;

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

.dalex-roof-logo svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Loader content */
.dalex-loader-content {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.dalex-loader-title {
    color: #113f6d;
    font-size: 31px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.7px;
}

.dalex-loader-message {
    color: #788ba0;
    font-size: 16px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}

/* Animated dots */
.dalex-loader-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 5px;
}

.dalex-loader-dots span {
    width: 5px;
    height: 5px;

    border-radius: 50%;
    background: #5e93c7;

    animation: dalexDot 1.2s ease-in-out infinite;
}

.dalex-loader-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.dalex-loader-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

/* Optional progress line */
.dalex-progress {
    width: 230px;
    height: 4px;
    margin-top: 9px;

    overflow: hidden;

    border-radius: 50px;
    background: #e9f1f9;
}

.dalex-progress::before {
    content: "";
    display: block;

    width: 45%;
    height: 100%;

    border-radius: inherit;

    background: linear-gradient(
        90deg,
        #8bc4f5,
        #1e78c7,
        #0d4f91
    );

    animation: dalexProgress 1.5s ease-in-out infinite;
}

@keyframes dalexRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes dalexPulse {
    0%,
    100% {
        transform: scale(0.88);
        opacity: 0.45;
    }

    50% {
        transform: scale(1.12);
        opacity: 1;
    }
}

@keyframes dalexDot {
    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: 0.35;
    }

    40% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

@keyframes dalexProgress {
    0% {
        transform: translateX(-120%);
    }

    100% {
        transform: translateX(280%);
    }
}

/* Mobile responsive */
@media (max-width: 600px) {
    .dalex-loader {
        min-width: auto;
        width: calc(100% - 32px);

        flex-direction: column;
        gap: 18px;

        padding: 28px 20px;
        text-align: center;
    }

    .dalex-loader-icon {
        width: 105px;
        height: 105px;
    }

    .dalex-roof-logo {
        width: 58px;
        height: 58px;
    }

    .dalex-loader-title {
        font-size: 26px;
    }

    .dalex-progress {
        width: 210px;
        margin-inline: auto;
    }
}

/* Success Popup */
.success-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.64);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    animation: popupFadeIn 0.25s ease;
    font-family: Arial, sans-serif;
}

.success-popup {
    position: relative;
    width: 100%;
    max-width: 500px;
    padding: 42px 38px 32px;
    overflow: hidden;
    text-align: center;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 22px;
    box-shadow:
        0 30px 70px rgba(15, 23, 42, 0.26),
        0 8px 24px rgba(15, 23, 42, 0.12);
    animation: popupScaleIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.success-popup::before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    content: "";
    background: linear-gradient(90deg, #0284c7, #0f67b1, #22c55e);
}

.popup-close {
    position: absolute;
    top: 16px;
    right: 17px;
    display: flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #64748b;
    font-family: Arial, sans-serif;
    font-size: 26px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    background: #f1f5f9;
    border: 0;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.popup-close:hover {
    color: #0f172a;
    background: #e2e8f0;
    transform: rotate(90deg);
}

.success-icon {
    display: flex;
    width: 76px;
    height: 76px;
    align-items: center;
    justify-content: center;
    margin: 0 auto 22px;
    color: #ffffff;
    background: linear-gradient(145deg, #22c55e, #16a34a);
    border: 7px solid #dcfce7;
    border-radius: 50%;
    box-shadow: 0 12px 25px rgba(34, 197, 94, 0.25);
}

.success-icon svg {
    width: 34px;
    height: 34px;
}

.popup-content h2 {
    margin: 0 0 12px;
    color: #0f172a;
    font-family: Arial, sans-serif;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.4px;
    line-height: 1.2;
}

.popup-content p {
    max-width: 400px;
    margin: 0 auto;
    color: #64748b;
    font-family: Arial, sans-serif;
    font-size: 15px;
    line-height: 1.65;
}

.popup-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #e8edf3;
}

.popup-btn {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 21px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 10px;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.popup-btn:hover {
    transform: translateY(-2px);
}

.secondary-btn {
    color: #075985;
    background: #ffffff;
    border-color: #bae6fd;
}

.secondary-btn:hover {
    background: #f0f9ff;
    border-color: #7dd3fc;
    box-shadow: 0 8px 18px rgba(14, 165, 233, 0.12);
}

.primary-btn {
    color: #ffffff;
    background: linear-gradient(135deg, #0873bd, #07559a);
    box-shadow: 0 8px 18px rgba(7, 89, 154, 0.24);
}

.primary-btn:hover {
    background: linear-gradient(135deg, #0765a8, #064a87);
    box-shadow: 0 12px 24px rgba(7, 89, 154, 0.3);
}

.primary-btn svg {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
}

.primary-btn:hover svg {
    transform: translateX(3px);
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes popupScaleIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.96);
    }

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

@media (max-width: 520px) {
    .success-popup {
        padding: 38px 22px 24px;
        border-radius: 18px;
    }

    .popup-content h2 {
        font-size: 23px;
    }

    .popup-actions {
        flex-direction: column-reverse;
    }

    .popup-btn {
        width: 100%;
    }
}
