/* ========== Floating Button ========== */
.floating-enroll-wrapper {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 9998;
}

.floating-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 6px 24px rgba(16, 185, 129, 0.35),
        0 0 0 0 rgba(16, 185, 129, 0.6);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    overflow: hidden;
    position: relative;
    width: 56px;
    height: 56px;
    animation: pulse 2.5s infinite;
}

/* Pulse animation */
@keyframes pulse {
    0%, 100% {
        box-shadow:
            0 6px 24px rgba(16, 185, 129, 0.35),
            0 0 0 0 rgba(16, 185, 129, 0.6);
    }
    50% {
        box-shadow:
            0 6px 24px rgba(16, 185, 129, 0.35),
            0 0 0 18px rgba(16, 185, 129, 0);
    }
}

.floating-btn:hover {
    width: 220px;
    padding-right: 20px;
    box-shadow:
        0 10px 40px rgba(16, 185, 129, 0.5),
        0 0 50px rgba(5, 150, 105, 0.3);
    transform: translateY(-5px) scale(1.03);
    animation: none;
}

.floating-btn:active {
    transform: translateY(-2px) scale(0.98);
}

/* Ripple waves */
.floating-btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    width: 100%;
    height: 100%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    animation: ripple-wave 3s infinite;
    pointer-events: none;
}

.floating-btn .ripple:nth-child(2) { animation-delay: 1s; }
.floating-btn .ripple:nth-child(3) { animation-delay: 2s; }

.floating-btn:hover .ripple {
    animation: none;
    opacity: 0;
}

@keyframes ripple-wave {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

/* Glow effect */
.floating-btn .glow {
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(135deg, #10b981, #059669, #34d399);
    border-radius: 50px;
    z-index: -1;
    filter: blur(18px);
    opacity: 0;
    transition: opacity 0.3s;
}

.floating-btn:hover .glow {
    opacity: 0.7;
}

/* Icon */
.floating-btn .btn-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 24px;
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.floating-btn:hover .btn-icon {
    transform: rotate(360deg) scale(1.1);
}

/* Text */
.floating-btn .btn-text {
    white-space: nowrap;
    font-size: 16px;
    font-weight: 700;
    opacity: 0;
    width: 0;
    transition: all 0.4s ease 0.1s;
}

.floating-btn:hover .btn-text {
    opacity: 1;
    width: auto;
}

/* ========== Floating Form ========== */
.floating-form {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 400px;
    max-width: 90vw;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.92);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    z-index: 9999;
}

.floating-form.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Backdrop blur */
.form-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.form-container {
    position: relative;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.96) 0%,
        rgba(255, 255, 255, 0.88) 100%);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    padding: 24px;
    overflow: hidden;
}

/* Floating particles */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 5px;
    height: 5px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    opacity: 0.4;
    animation: particle-float 7s infinite;
}

.particle:nth-child(1) { left: 15%; animation-delay: 0s; }
.particle:nth-child(2) { left: 35%; animation-delay: 1.4s; }
.particle:nth-child(3) { left: 55%; animation-delay: 2.8s; }
.particle:nth-child(4) { left: 75%; animation-delay: 4.2s; }
.particle:nth-child(5) { left: 90%; animation-delay: 5.6s; }

@keyframes particle-float {
    0%, 100% {
        transform: translateY(100%) scale(0);
        opacity: 0;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(-100%) scale(1.2);
        opacity: 0;
    }
}

/* Form header */
.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid transparent;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.2), transparent)
                bottom / 100% 2px no-repeat;
    position: relative;
    z-index: 1;
}

.form-header h5 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
}

.gradient-text {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: text-gradient-shift 3s ease infinite;
    background-size: 200% 200%;
}

@keyframes text-gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.close-btn {
    background: rgba(16, 185, 129, 0.1);
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    font-size: 18px;
    color: #10b981;
}

.close-btn:hover {
    background: rgba(16, 185, 129, 0.2);
    transform: rotate(90deg) scale(1.1);
}

/* Form fields */
form {
    position: relative;
    z-index: 1;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 7px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.85;
}

.input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 13px 16px;
    border: 2px solid rgba(16, 185, 129, 0.15);
    border-radius: 10px;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.85);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    outline: none;
}

.form-input:focus {
    border-color: transparent;
    background: #fff;
    transform: translateY(-2px);
    box-shadow:
        0 6px 20px rgba(16, 185, 129, 0.15),
        0 0 0 4px rgba(16, 185, 129, 0.08);
}

/* Animated border */
.input-border {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #10b981, #059669);
    transition: width 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    border-radius: 2px;
}

.form-input:focus + .input-border {
    width: 100%;
}

/* Submit button */
.submit-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow:
        0 10px 28px rgba(16, 185, 129, 0.4),
        0 0 35px rgba(5, 150, 105, 0.25);
}

.submit-btn:active {
    transform: translateY(-1px);
}

.btn-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Button ripple */
.btn-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.submit-btn:active .btn-ripple {
    width: 400px;
    height: 400px;
    transition: width 0s, height 0s;
}

/* Success message */
.success-message {
    display: none;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    padding: 14px 18px;
    border-radius: 10px;
    margin-top: 16px;
    font-weight: 700;
    font-size: 14px;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.success-message.show {
    display: flex;
    animation: slide-up 0.4s ease;
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Screen backdrop */
.screen-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.35);
    z-index: 9997;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

.screen-backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .floating-enroll-wrapper {
        bottom: 20px;
        right: 20px;
    }

    .floating-form {
        width: calc(100vw - 40px);
        right: -5px;
        bottom: 70px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .floating-btn {
        width: 52px;
        height: 52px;
    }

    .floating-btn .btn-icon {
        width: 52px;
        height: 52px;
        font-size: 22px;
    }
}
