.dm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.dm-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.dm-overlay * {
    box-sizing: border-box;
}

.dm-modal {
    background: white;
    border-radius: 12px;
    max-width: 850px;
    width: 100%;
    display: flex;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    max-height: 380px;
    font-family: 'Gilroy', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.dm-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    z-index: 10;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 50%;
    line-height: 1;
    padding: 0;
}

.dm-close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.dm-left {
    flex: 1;
    padding: 25px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    text-align: left;
}

.dm-right {
    flex: 1;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    position: relative;
    overflow: hidden;
    min-height: 380px;
}

.dm-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

#dm-form-content {
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#dm-form-content.fade-out {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

.dm-modal h2 {
    color: #333;
    font-size: 22px;
    margin-bottom: 8px;
    font-weight: 600;
    line-height: 1.2;
    margin-top: 0;
}

.dm-subtitle {
    color: #666;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 18px;
    padding: 0;
}

.dm-form-group {
    margin-bottom: 10px;
}

.dm-modal input[type="text"],
.dm-modal input[type="email"] {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
    margin: 0;
    background: #fff;
    color: #333;
}

.dm-modal input:focus {
    outline: none;
    border-color: #4A90E2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.dm-submit-btn {
    width: 100%;
    padding: 11px;
    background: #4A90E2;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 8px;
    text-transform: none;
}

.dm-submit-btn:hover {
    background: #357ABD;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.3);
}

.dm-submit-btn:active {
    transform: translateY(0);
}

.dm-privacy-text {
    color: #888;
    font-size: 12px;
    text-align: center;
    margin-top: 5px;
}

.dm-success-message,
.dm-error-message {
    position: relative;
    width: 100%;
    text-align: center;
    padding: 20px 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease 0.3s;
}

.dm-success-message.show,
.dm-error-message.show {
    opacity: 1;
    visibility: visible;
}

.dm-success-icon,
.dm-error-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 35px;
    font-weight: bold;
    animation: dm-scaleIn 0.6s ease 0.5s both;
}

.dm-success-icon {
    background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(76, 175, 80, 0.3);
}

.dm-error-icon {
    background: linear-gradient(135deg, #f44336 0%, #e57373 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(244, 67, 54, 0.3);
}

.dm-success-title,
.dm-error-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
}

.dm-success-title {
    color: #4CAF50;
}

.dm-error-title {
    color: #f44336;
}

.dm-message-text {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.dm-hidden {
    display: none !important;
}

@keyframes dm-scaleIn {
    from {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .dm-modal {
        flex-direction: column;
        max-height: 90vh;
        overflow-y: auto;
    }

    .dm-right {
        min-height: 250px;
        order: -1;
    }

    .dm-left {
        padding: 30px 25px;
    }

    .dm-modal h2 {
        font-size: 24px;
    }

    .dm-subtitle {
        font-size: 14px;
    }

    .dm-close-btn {
        background: rgba(255, 255, 255, 0.9);
        top: 10px;
        right: 10px;
    }
}

@media (max-width: 480px) {
    .dm-left {
        padding: 25px 20px;
    }

    .dm-modal h2 {
        font-size: 22px;
    }

    .dm-modal input,
    .dm-submit-btn {
        padding: 12px;
        font-size: 16px !important;
        /* Prevents iOS zoom */
    }
}

/* Secondary Button (Close, Try Again) */
.dm-btn-secondary {
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    display: inline-block;
}

.dm-btn-secondary:hover {
    border-color: #999;
    color: #333;
    background: #f9f9f9;
}

.dm-loading {
    position: relative;
    width: 100%;
    text-align: center;
    padding: 40px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.dm-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #4A90E2;
    border-radius: 50%;
    animation: dm-spin 1s linear infinite;
}

@keyframes dm-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}