@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700&display=swap");

/* NoCRM Enterprise Frontend Form Styles */

.nocrm-form-container,
.nocrm-form-container *,
.nocrm-popup-overlay,
.nocrm-popup-overlay * {
    box-sizing: border-box;
    font-family: 'Open Sans', sans-serif;
}

/* Form Container */
.nocrm-form-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px;
    text-align: center;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.nocrm-form-container:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.nocrm-form {
    display: flex;
    flex-direction: column;
}

/* Form Header */
.nocrm-form-header {
    padding: 0;
    margin-bottom: 30px;
}

.nocrm-form-badge {
    font-size: 0.75rem;
    color: #6366f1; /* Indigo */
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.nocrm-form-title {
    color: #111827;
    font-size: 2.1rem;
    font-weight: 600;
    margin: 0 0 10px;
    letter-spacing: 1px;
}

.nocrm-form-subtitle {
    color: #6b7280;
    margin: 0;
    font-size: 1rem;
}

/* Form Fields */

.nocrm-form-fields {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.required {
    color: #ffb3c1;
}

.nocrm-field {
    margin: 0;
}

.nocrm-input-field {
    position: relative;
    border-bottom: 2px solid #e5e7eb;
    transition: border-color 0.3s ease;
}

.nocrm-input-field:focus-within {
    border-bottom-color: #2563eb;
}

.nocrm-input-field input,
.nocrm-input-field textarea {
    width: 100%;
    height: 44px;
    background: transparent !important;
    border: none;
    outline: none;
    font-size: 16px;
    color: #111827 !important;
    padding: 0 10px;
    box-shadow: none !important;
}

.nocrm-form input,
.nocrm-form textarea,
.nocrm-form select {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    min-height: initial;
}

.nocrm-form textarea {
    min-height: 140px !important;
    padding: 16px 18px;
    overflow: auto;
    resize: vertical;
}

.nocrm-input-field textarea {
    min-height: 110px;
    resize: vertical;
    padding: 12px 10px;
}

.nocrm-input-field label {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 16px;
    pointer-events: none;
    transition: 0.3s ease;
}

.nocrm-input-field input::placeholder,
.nocrm-input-field textarea::placeholder {
    color: transparent;
}

.nocrm-input-field input:-webkit-autofill,
.nocrm-input-field input:-webkit-autofill:hover,
.nocrm-input-field input:-webkit-autofill:focus,
.nocrm-input-field textarea:-webkit-autofill,
.nocrm-input-field textarea:-webkit-autofill:hover,
.nocrm-input-field textarea:-webkit-autofill:focus {
    -webkit-text-fill-color: #111827;
    transition: background-color 5000s ease-in-out 0s;
    background: transparent;
}

.nocrm-input-field:focus-within label {
    font-size: 0.9rem;
    top: 12px;
    transform: translateY(-100%);
    color: #2563eb;
}

.nocrm-input-field input:focus + label,
.nocrm-input-field input:not(:placeholder-shown) + label,
.nocrm-input-field textarea:focus + label,
.nocrm-input-field textarea:not(:placeholder-shown) + label {
    font-size: 0.9rem;
    top: 12px;
    transform: translateY(-100%);
    color: #2563eb;
}

.nocrm-phone-field {
    position: relative;
    padding-top: 6px;
    overflow: visible;
}

.nocrm-phone-field.nocrm-phone-enhanced {
    position: relative;
    border-bottom: 2px solid #e5e7eb;
    transition: border-color 0.3s ease;
}

.nocrm-phone-field.nocrm-phone-enhanced.nocrm-phone-focused {
    border-bottom-color: #2563eb;
}

.nocrm-phone-field.nocrm-phone-enhanced label {
    left: 85px;
    top: 50%;
    transform: translateY(-50%);
}

.nocrm-phone-field.nocrm-phone-enhanced.nocrm-phone-focused label,
.nocrm-phone-field.nocrm-phone-enhanced.nocrm-phone-filled label {
    font-size: 0.9rem;
    top: 12px;
    transform: translateY(-100%);
    color: #2563eb;
    left: 85px;
}

.nocrm-phone-field.nocrm-phone-enhanced .iti {
    width: 100% !important;
    position: relative;
    overflow: visible;
}

.nocrm-phone-field.nocrm-phone-enhanced .iti--allow-dropdown {
    width: 100% !important;
}

.nocrm-phone-field.nocrm-phone-enhanced .iti--allow-dropdown .iti__flag-container {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    padding: 0;
}

.nocrm-phone-field.nocrm-phone-enhanced .iti__flag-container {
    background: transparent;
    border: none;
    border-right: 1px solid #e5e7eb;
    box-shadow: none;
    transition: all 0.3s ease;
    height: 44px;
    display: flex;
    align-items: center;
    padding: 0 8px 0 0;
    width: 75px;
}

.nocrm-phone-field.nocrm-phone-enhanced.nocrm-phone-focused .iti__flag-container {
    border-right-color: #d1d5db;
}

.nocrm-phone-field.nocrm-phone-enhanced .iti__selected-flag {
    cursor: pointer;
    padding: 0;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    padding-left: 8px;
}

.nocrm-phone-field.nocrm-phone-enhanced .iti__selected-flag::after {
    border-top-color: #6b7280;
    margin-left: auto;
}

.nocrm-phone-field.nocrm-phone-enhanced .iti__selected-flag:hover {
    background: rgba(37, 99, 235, 0.05);
}

.nocrm-phone-field.nocrm-phone-enhanced .iti__selected-dial-code {
    color: #6b7280;
    font-weight: 500;
    font-size: 13px;
    margin: 0;
}

.nocrm-phone-field.nocrm-phone-enhanced input {
    padding-left: 85px !important;
    padding-right: 10px !important;
    width: 100%;
    border: none !important;
    background: transparent !important;
    height: 44px;
}

.nocrm-phone-field.nocrm-phone-enhanced .iti__country-list {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    margin-top: 4px;
    left: 0 !important;
    min-width: 250px;
    max-width: 350px;
    box-sizing: border-box;
    overflow-x: hidden; /* tránh thanh cuộn ngang */
    max-height: 320px; /* chỉ cuộn dọc khi dài */
    overflow-y: auto;
}

/* Force dropdown to open downwards in popup */
.nocrm-popup-body .nocrm-phone-field.nocrm-phone-enhanced .iti__country-list {
    top: 100% !important;
    bottom: auto !important;
    margin-top: 8px; /* tạo khoảng cách rõ ràng với input */
    overflow-x: hidden; /* không cho cuộn ngang trong popup */
}

/* HIDE search box - simplified mode */
.nocrm-phone-field.nocrm-phone-enhanced .iti__search-container {
    display: none !important;
}

/* Enable flexbox for reordering countries - ONLY when dropdown is visible */
.nocrm-phone-field.nocrm-phone-enhanced .iti__country-list:not(.iti__hide) {
    display: flex !important;
    flex-direction: column !important;
}

.nocrm-phone-field.nocrm-phone-enhanced .iti__country-list .iti__country {
    color: #374151;
    padding: 10px 12px;
    transition: all 0.2s ease;
}

.nocrm-phone-field.nocrm-phone-enhanced .iti__country-list .iti__country:hover,
.nocrm-phone-field.nocrm-phone-enhanced .iti__country-list .iti__country.iti__highlight {
    background-color: #eff6ff;
    color: #111827;
}

.nocrm-phone-field.nocrm-phone-enhanced .iti__country-list .iti__country.iti__active {
    background-color: #dbeafe;
    color: #1e40af;
    font-weight: 500;
}

.nocrm-phone-field.nocrm-phone-enhanced .iti__country-list .iti__divider {
    border-bottom: 1px solid #e5e7eb;
    margin: 4px 0;
}

.nocrm-phone-field.nocrm-phone-enhanced .iti__country-list .iti__country-name {
    margin-left: 8px;
}

.nocrm-phone-field.nocrm-phone-enhanced .iti__country-list .iti__dial-code {
    color: #6b7280;
    font-size: 13px;
}

/* Ensure flag container aligns properly */
.nocrm-phone-field.nocrm-phone-enhanced .iti--allow-dropdown input {
    padding-left: 85px !important; /* chừa chỗ cho cờ + mã vùng */
}

/* Wrapper to contain the phone field */
.nocrm-phone-field.nocrm-phone-enhanced .iti__flag-container,
.nocrm-phone-field.nocrm-phone-enhanced input {
    margin-bottom: 0;
}

.nocrm-textarea-field {
    border-bottom: none;
    padding-bottom: 0;
    text-align: left;
}

.nocrm-textarea-field label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 10px;
}

.nocrm-textarea-field textarea {
    width: 100%;
    min-height: 140px !important;
    background: #f9fafb !important;
    border: 1px solid #d1d5db !important;
    border-radius: 8px;
    outline: none;
    font-size: 16px;
    color: #111827 !important;
    padding: 16px 18px;
    resize: vertical;
    box-shadow: none !important;
    transition: border-color 0.3s ease;
}

.nocrm-textarea-field textarea:focus {
    border-color: #2563eb !important;
}

.nocrm-select-field {
    position: relative;
    text-align: left;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 6px;
    transition: border-color 0.3s ease;
}

.nocrm-select-field:focus-within {
    border-bottom-color: #2563eb;
}

.nocrm-select-field label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 6px;
}

.nocrm-select-field select {
    width: 100%;
    height: 44px;
    padding: 0 10px;
    border: none;
    outline: none;
    background: transparent;
    color: #111827 !important;
    font-size: 16px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: 0.3s ease;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-size: 16px;
    background-position: right 16px center;
    box-shadow: none !important;
}

.nocrm-select-field select option {
    color: #111827;
}

.nocrm-select-field select:focus {
    color: #111827;
}

/* Form Footer */
.nocrm-form-footer {
    padding: 0;
    margin-top: 0;
}

.nocrm-submit-btn {
    width: 100%;
    background-color: #6366f1 !important; /* Indigo */
    color: #ffffff !important;
    border: none;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
}

.nocrm-submit-btn:hover {
    background-color: #4f46e5 !important; /* darker indigo */
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Ensure color inside popup context as well */
.nocrm-popup-overlay .nocrm-submit-btn {
    background-color: #6366f1 !important;
    color: #ffffff !important;
}

.nocrm-popup-overlay .nocrm-submit-btn:hover {
    background-color: #4f46e5 !important;
    color: #ffffff !important;
}

/* Ensure inner texts are white */
.nocrm-submit-btn .button-text,
.nocrm-submit-btn .button-loading {
    color: #ffffff !important;
    fill: #ffffff !important;
}

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

.nocrm-submit-btn.loading {
    opacity: 0.8;
    cursor: not-allowed;
    transform: none;
}

.nocrm-submit-btn.loading:hover {
    transform: none;
}

.button-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.button-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Form Message */
.nocrm-form-message {
    margin: 10px 30px 0 30px;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 500;
    text-align: center;
    font-size: 13px;
    line-height: 1.3;
}

/* Professional Success Notification - ULTIMATE CENTERING */
.professional-success-notification {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 10px !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06) !important;

    /* ULTIMATE CENTERING SOLUTION */
    width: 560px !important;
    max-width: calc(100vw - 40px) !important;
    margin: 0 !important;
    padding: 0 !important;

    /* FIXED POSITIONING TO ESCAPE ALL CONTAINERS */
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;

    /* HIGH Z-INDEX TO APPEAR ABOVE EVERYTHING */
    z-index: 999999 !important;

    /* VISUAL PROPERTIES */
    overflow: hidden !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: block !important;
}

.professional-success-notification.fade-out {
    opacity: 0 !important;
    transform: translate(-50%, -50%) translateY(-20px) scale(0.95) !important;
}

.notification-content {
    padding: 32px 28px 28px 28px !important;
    text-align: center !important;
    position: relative !important;
    z-index: 2 !important;
}

.success-icon-wrapper {
    margin-bottom: 24px !important;
}

.success-checkmark {
    display: inline-block !important;
    animation: checkmarkScale 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.success-checkmark svg {
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.10)) !important;
}

.notification-text {
    margin-bottom: 28px !important;
}

.success-title {
    font-size: 28px !important;
    font-weight: 600 !important;
    color: #111827 !important;
    margin: 0 0 12px 0 !important;
    letter-spacing: -0.025em !important;
    line-height: 1.2 !important;
}

.success-subtitle {
    font-size: 16px !important;
    color: #6b7280 !important;
    line-height: 1.6 !important;
    margin: 0 0 20px 0 !important;
    font-weight: 400 !important;
    max-width: 420px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.notification-meta {
    display: flex !important;
    justify-content: space-between !important;
    gap: 16px !important;
    background: #fafafa !important;
    border-radius: 8px !important;
    padding: 12px 14px !important;
    border: 1px solid #e5e7eb !important;
}

.meta-item {
    flex: 1 !important;
    text-align: center !important;
}

.meta-label {
    display: block !important;
    font-size: 12px !important;
    color: #6b7280 !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 2px !important;
}

.meta-value {
    display: block !important;
    font-size: 14px !important;
    color: #111827 !important;
    font-weight: 600 !important;
}

.notification-progress {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 3px !important;
    background: #f3f4f6 !important;
    border-radius: 0 0 10px 10px !important;
    overflow: hidden !important;
}

.progress-bar {
    height: 100% !important;
    background: #111827 !important;
    width: 0% !important;
    transition: none !important;
    border-radius: 0 0 10px 10px !important;
}

.progress-bar.animate {
    width: 100% !important;
    transition: width 4.5s linear !important;
}

/* Animations */
@keyframes checkmarkScale {
    0% {
        transform: scale(0) rotate(-45deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.1) rotate(-10deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .professional-success-notification {
        width: calc(100vw - 32px) !important;
        max-width: none !important;
        border-radius: 16px !important;
        /* Keep fixed positioning for mobile too */
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        max-height: calc(100vh - 32px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .notification-content {
        padding: 24px 20px 20px 20px !important;
    }

    .success-title {
        font-size: 22px !important;
    }

    .success-subtitle {
        font-size: 15px !important;
        max-width: 100% !important;
        margin-bottom: 16px !important;
    }

    .notification-text {
        margin-bottom: 16px !important;
    }

    .notification-meta {
        flex-direction: column !important;
        gap: 12px !important;
        padding: 16px !important;
    }

    .meta-item {
        text-align: left !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    .meta-label,
    .meta-value {
        display: inline !important;
        margin: 0 !important;
    }

    .progress-bar,
    .progress-bar.animate {
        border-radius: 0 0 12px 12px !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .professional-success-notification {
        background: #ffffff !important;
        border-color: #e5e7eb !important;
    }

    .success-title {
        color: #111827 !important;
    }

    .success-subtitle {
        color: #6b7280 !important;
    }

    .notification-meta {
        background: #fafafa !important;
        border-color: #e5e7eb !important;
    }

    .meta-label {
        color: #6b7280 !important;
    }

    .meta-value {
        color: #111827 !important;
    }
}

.nocrm-form-message.error {
    background: var(--nocrm-error-light);
    color: var(--nocrm-error);
    border: 1px solid var(--nocrm-error);
}

/* Two Column Layout */
.nocrm-form-fields.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.nocrm-field.full-width {
    grid-column: 1 / -1;
}

/* Name Fields Row - Two Column Layout */
.nocrm-name-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.nocrm-name-row .nocrm-field {
    margin-bottom: 0;
}

/* Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nocrm-form-container {
    animation: slideInUp 0.6s ease-out;
}

.nocrm-field {
    animation: slideInUp 0.6s ease-out;
}

.nocrm-field:nth-child(1) { animation-delay: 0.1s; }
.nocrm-field:nth-child(2) { animation-delay: 0.2s; }
.nocrm-field:nth-child(3) { animation-delay: 0.3s; }
.nocrm-field:nth-child(4) { animation-delay: 0.4s; }
.nocrm-field:nth-child(5) { animation-delay: 0.5s; }

/* Disable animations for popup - instant appearance */
.nocrm-popup-overlay .nocrm-form-container {
    animation: none !important;
}

.nocrm-popup-overlay .nocrm-field {
    animation: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nocrm-form-container {
        margin: 0 15px;
        padding: 32px;
        border-radius: 15px;
    }

    .nocrm-form-title {
        font-size: 20px;
    }

    .nocrm-form-fields.two-column {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .nocrm-field {
        margin-bottom: 4px;
    }

    .nocrm-submit-btn {
        font-size: 16px;
        padding: 14px 20px;
        margin-top: 0 !important;
    }

    .nocrm-phone-field.nocrm-phone-enhanced .iti__flag-container {
        min-width: 80px;
        padding: 0 8px;
    }

    .nocrm-phone-field.nocrm-phone-enhanced .iti__selected-dial-code {
        font-size: 13px;
    }

    .nocrm-phone-field.nocrm-phone-enhanced .iti__country-list {
        min-width: 280px;
    }
}

@media (max-width: 480px) {
    .nocrm-form-container {
        margin: 0 10px;
        padding: 28px 24px;
    }

    .nocrm-form-header,
    .nocrm-form-fields,
    .nocrm-form-footer {
        padding-left: 0;
        padding-right: 0;
    }

    .nocrm-input-field input,
    .nocrm-input-field textarea,
    .nocrm-select-field select {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .nocrm-phone-field.nocrm-phone-enhanced .iti__flag-container {
        min-width: 70px;
        padding: 0 6px;
    }

    .nocrm-phone-field.nocrm-phone-enhanced .iti__selected-dial-code {
        font-size: 12px;
    }

    .nocrm-phone-field.nocrm-phone-enhanced .iti__country-list {
        min-width: 260px;
        max-width: 320px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --nocrm-surface: #1e293b;
        --nocrm-border: #334155;
        --nocrm-text-primary: #f1f5f9;
        --nocrm-text-secondary: #94a3b8;
    }

    .nocrm-field input,
    .nocrm-field textarea,
    .nocrm-field select {
        background: transparent;
        color: var(--nocrm-text-primary);
    }
}

/* Print Styles */
@media print {
    .nocrm-form-container {
        box-shadow: none;
        border: 1px solid #000;
    }

    .nocrm-submit-btn {
        display: none;
    }
}

/* =================================================
   POPUP STYLES
   ================================================= */

.nocrm-popup-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: transparent !important;
    z-index: 999999 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 60px 20px 20px 20px !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.3s ease-out !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
    box-sizing: border-box !important;
}

/* Dark overlay background - behind form */
.nocrm-popup-overlay::before {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.6) !important;
    z-index: 1 !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease-out !important;
}

.nocrm-popup-overlay.show {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.nocrm-popup-overlay.show::before {
    opacity: 1 !important;
}

.nocrm-popup-content {
    position: relative !important;
    max-width: 600px !important;
    width: 100% !important;
    max-height: calc(100vh - 80px) !important;
    overflow: hidden !important;
    opacity: 0 !important;
    transform: translateY(20px) !important;
    transition: all 0.3s ease-out !important;
    margin: 0 auto !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 8px !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    z-index: 10 !important;
}

/* Clean popup content - no decorations */

.nocrm-popup-overlay.show .nocrm-popup-content {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.nocrm-popup-close {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    width: 40px !important;
    height: 40px !important;
    background: #f3f4f6 !important;
    color: #6b7280 !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 50% !important;
    font-size: 22px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    z-index: 100 !important;
    margin: 0 !important;
}

.nocrm-popup-close:hover {
    background: #e5e7eb !important;
    color: #111827 !important;
}

/* Popup styling */
.nocrm-popup-overlay .nocrm-form-container {
    margin: 0;
    max-width: none;
    width: 100%;
    padding: 40px 40px 35px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    z-index: 10;
}

.nocrm-popup-overlay .nocrm-submit-btn:active {
    transform: translateY(0);
    box-shadow: none;
}


/* =================================================
   ULTRA MODERN SUCCESS MESSAGE WITH GLASSMORPHISM
   ================================================= */

.modern-success-container {
    position: relative !important;
    min-height: 500px !important;
    background: #ffffff !important;
    border-radius: 8px !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto !important;
    max-width: 650px !important;
}

.background-blur {
    display: none !important;
}

.floating-elements {
    display: none !important;
}

.float-circle {
    display: none !important;
}

.float-1 {
    width: 60px !important;
    height: 60px !important;
    top: 10% !important;
    left: 15% !important;
    animation-delay: 0s !important;
}

.float-2 {
    width: 40px !important;
    height: 40px !important;
    top: 20% !important;
    right: 20% !important;
    animation-delay: 1.5s !important;
}

.float-3 {
    width: 80px !important;
    height: 80px !important;
    bottom: 15% !important;
    left: 10% !important;
    animation-delay: 3s !important;
}

.success-content-modern {
    position: relative !important;
    z-index: 10 !important;
    text-align: center !important;
    padding: 60px 40px !important;
    width: 100% !important;
}

.success-icon-modern {
    position: relative !important;
    display: inline-block !important;
    margin-bottom: 32px !important;
}

.icon-bg-glow {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 140px !important;
    height: 140px !important;
    background: radial-gradient(circle, rgba(34, 197, 94, 0.4) 0%, transparent 70%) !important;
    border-radius: 50% !important;
    animation: pulseGlow 3s ease-in-out infinite !important;
}

.checkmark-container {
    position: relative !important;
    z-index: 2 !important;
}

.checkmark {
    filter: drop-shadow(0 10px 30px rgba(34, 197, 94, 0.4)) !important;
}

.checkmark-circle {
    stroke-dasharray: 283 !important;
    stroke-dashoffset: 283 !important;
    transition: stroke-dashoffset 0.6s ease-in-out !important;
}

.checkmark-circle.animate {
    stroke-dashoffset: 0 !important;
}

.checkmark-check {
    stroke-dasharray: 58 !important;
    stroke-dashoffset: 58 !important;
    transition: stroke-dashoffset 0.3s ease-in-out 0.3s !important;
}

.checkmark-check.animate {
    stroke-dashoffset: 0 !important;
}

.success-sparkles {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    pointer-events: none !important;
}

.sparkle {
    position: absolute !important;
    font-size: 24px !important;
    opacity: 0 !important;
    animation: sparkleFloat 3s ease-in-out infinite !important;
}

.sparkle-1 {
    top: -80px !important;
    left: -40px !important;
    animation-delay: 0.5s !important;
}

.sparkle-2 {
    top: -60px !important;
    right: -50px !important;
    animation-delay: 1s !important;
}

.sparkle-3 {
    bottom: -70px !important;
    left: -30px !important;
    animation-delay: 1.5s !important;
}

.sparkle-4 {
    bottom: -80px !important;
    right: -40px !important;
    animation-delay: 2s !important;
}

.success-text-modern {
    margin-bottom: 40px !important;
}

.success-title-modern {
    font-size: 48px !important;
    font-weight: 800 !important;
    margin: 0 0 16px 0 !important;
    background: linear-gradient(135deg, #1f2937 0%, #4f46e5 50%, #06b6d4 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    letter-spacing: -0.02em !important;
    line-height: 1.1 !important;
}

.success-subtitle-modern {
    font-size: 18px !important;
    color: rgba(75, 85, 99, 0.8) !important;
    line-height: 1.6 !important;
    margin: 0 !important;
    font-weight: 400 !important;
    max-width: 400px !important;
    margin: 0 auto !important;
}

.success-info-cards {
    display: flex !important;
    gap: 24px !important;
    justify-content: center !important;
    margin-bottom: 48px !important;
    flex-wrap: wrap !important;
}

.info-card {
    background: #f9fafb !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    padding: 24px !important;
    min-width: 180px !important;
    transition: all 0.3s ease !important;
    opacity: 0 !important;
    transform: translateY(20px) !important;
}

.info-card.visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.info-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    background: #ffffff !important;
}

.card-icon {
    width: 48px !important;
    height: 48px !important;
    background: #eff6ff !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto 16px auto !important;
    color: #2563eb !important;
}

.card-content {
    text-align: center !important;
}

.card-label {
    font-size: 14px !important;
    color: rgba(75, 85, 99, 0.7) !important;
    margin-bottom: 4px !important;
    font-weight: 500 !important;
}

.card-value {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #1f2937 !important;
}

.success-actions-modern {
    text-align: center !important;
}

.btn-modern-primary {
    position: relative !important;
    background: #2563eb !important;
    color: white !important;
    border: none !important;
    padding: 14px 32px !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    overflow: hidden !important;
    transition: all 0.2s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 12px !important;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2) !important;
    text-decoration: none !important;
    font-family: inherit !important;
    min-width: 180px !important;
    justify-content: center !important;
}

.btn-modern-primary::before {
    display: none !important;
}

.btn-modern-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
    background: #1d4ed8 !important;
}

.btn-modern-primary:active {
    transform: translateY(0) !important;
}

.btn-icon-modern {
    transition: transform 0.3s ease !important;
}

.btn-modern-primary:hover .btn-icon-modern {
    transform: translateX(6px) !important;
}

.btn-ripple {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 0 !important;
    height: 0 !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.5) !important;
    transform: translate(-50%, -50%) !important;
    transition: width 0.3s ease, height 0.3s ease !important;
}

.btn-modern-primary:active .btn-ripple {
    width: 300px !important;
    height: 300px !important;
}

/* Animations */
@keyframes backgroundPulse {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

@keyframes floatUpDown {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.9;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

@keyframes sparkleFloat {
    0%, 100% {
        opacity: 0;
        transform: translateY(0) scale(1) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: translateY(-15px) scale(1.2) rotate(180deg);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .modern-success-container {
        margin: 16px !important;
        border-radius: 8px !important;
        min-height: 400px !important;
    }

    .success-content-modern {
        padding: 40px 24px !important;
    }

    .success-title-modern {
        font-size: 36px !important;
    }

    .success-subtitle-modern {
        font-size: 16px !important;
    }

    .success-info-cards {
        flex-direction: column !important;
        align-items: center !important;
        gap: 16px !important;
    }

    .info-card {
        min-width: 200px !important;
        padding: 20px !important;
    }

    .btn-modern-primary {
        padding: 16px 32px !important;
        width: 100% !important;
        max-width: 250px !important;
    }

    .float-circle {
        display: none !important;
    }
}

/* Dark Mode - Keep clean white design */

/* =================================================
   FLOATING TOGGLE BUTTON
   ================================================= */

.nocrm-floating-toggle {
    position: fixed !important;
    bottom: 90px !important;
    right: 15px !important;
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    background: #2563eb !important;
    border: none !important;
    color: white !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4) !important;
    z-index: 999999 !important;
    transition: all 0.2s ease !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.nocrm-floating-toggle:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.5) !important;
    background: #1d4ed8 !important;
}

.nocrm-floating-toggle:active {
    transform: scale(0.95);
}

.nocrm-floating-toggle svg {
    width: 32px !important;
    height: 32px !important;
    fill: none !important;
    stroke: white !important;
    stroke-width: 2 !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2)) !important;
}

/* Hide button when popup is open */
.nocrm-popup-open .nocrm-floating-toggle {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

/* Bounce animation - Disabled for clean design */
@keyframes floatBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .nocrm-popup-overlay {
        padding: 15px !important;
        align-items: flex-start !important;
        padding-top: 15px !important;
    }

    .nocrm-popup-overlay .nocrm-form-container {
        max-height: calc(100vh - 30px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 50px !important;
    }

    .nocrm-floating-toggle {
        bottom: 90px !important;
        right: 20px !important;
        width: 60px !important;
        height: 60px !important;
    }

    .nocrm-floating-toggle svg {
        width: 28px !important;
        height: 28px !important;
    }
}

@media (max-width: 480px) {
    .nocrm-popup-overlay {
        padding: 10px !important;
        align-items: flex-start !important;
        padding-top: 10px !important;
    }

    .nocrm-popup-overlay .nocrm-form-container {
        max-height: calc(100vh - 20px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 30px 20px 80px 20px !important;
    }

    /* Ensure submit button is visible */
    .nocrm-popup-overlay .nocrm-submit-btn {
        margin-bottom: 0 !important;
    }
}

/* Cloudflare Turnstile CAPTCHA - Simple & Always Visible */
.nocrm-turnstile-container {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    margin: 0 auto 20px auto !important;
    min-height: 65px !important;
}

.nocrm-turnstile-container .cf-turnstile {
    display: block !important;
    margin: 0 auto !important;
    visibility: visible !important;
}

/* Mobile responsive for Turnstile */
@media (max-width: 768px) {
    .nocrm-turnstile-container {
        margin-bottom: 16px !important;
    }
}

@media (max-width: 480px) {
    .nocrm-turnstile-container {
        margin-bottom: 12px !important;
    }
}
