/* ==========================================================================
   OTM LeadGen - Embedded Forms
   ========================================================================== */

.otm-leadgen-container {
    width: 100%;
    max-width: none;
}

.otm-leadgen-form .otm-field {
    margin-bottom: 16px;
}

.otm-leadgen-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
}

.otm-leadgen-form .otm-required {
    color: #d63638;
}

.otm-leadgen-form input[type="text"],
.otm-leadgen-form input[type="email"],
.otm-leadgen-form input[type="url"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}

.otm-leadgen-form input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.otm-leadgen-form .otm-submit-btn {
    width: 100%;
    padding: 14px 24px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.otm-leadgen-form .otm-submit-btn:hover {
    background: #005a87;
}

.otm-leadgen-form .otm-submit-btn:disabled {
    background: #999;
    cursor: not-allowed;
}

.otm-leadgen-loading {
    display: none;
    text-align: center;
    padding: 40px 20px;
}

.otm-leadgen-loading.active {
    display: block;
}

.otm-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: otm-spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

.otm-leadgen-result {
    display: none;
    padding: 0;
    background: transparent;
    border-radius: 0;
    border: none;
}

.otm-leadgen-result.active {
    display: block;
}

.otm-leadgen-result h3 {
    margin-top: 0;
}

.otm-leadgen-error {
    color: #d63638;
    padding: 16px;
    background: #fcf0f1;
    border-radius: 4px;
    margin-top: 16px;
}

.otm-leadgen-form.hidden {
    display: none;
}


/* ==========================================================================
   OTM LeadGen - Popups
   ========================================================================== */

.otm-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

.otm-popup-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.otm-popup-container {
    position: relative;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    animation: otm-popup-fade-in 0.3s ease;
    display: flex;
    flex-direction: column;
}

@keyframes otm-popup-fade-in {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.otm-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.otm-popup-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

.otm-popup-close-dark {
    color: #333;
}

.otm-popup-close-light {
    color: #fff;
}

.otm-popup-close-light:hover {
    background: rgba(255, 255, 255, 0.2);
}

.otm-popup-inner {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
}

.otm-popup-content {
    margin-bottom: 24px;
}

.otm-popup-form-wrap {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    overflow: hidden;
}

.otm-popup-cta-btn {
    display: inline-block;
    text-align: center;
    text-decoration: none;
    padding: 14px 24px;
    background: #1a1a1a;
    color: #fff;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.otm-popup-cta-btn:hover {
    background: #333;
}

.otm-popup-content img {
    max-width: 100%;
    height: auto;
}

.otm-popup-content h1,
.otm-popup-content h2,
.otm-popup-content h3 {
    margin-top: 0;
}

/* Popup Form Styles */
.otm-popup-form .otm-field {
    margin-bottom: 16px;
}

.otm-popup-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
}

.otm-popup-form .otm-required {
    color: #d63638;
}

.otm-popup-form input[type="text"],
.otm-popup-form input[type="email"],
.otm-popup-form input[type="url"] {
    width: 100%;
    padding: 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
}

.otm-popup-form input:focus {
    outline: none;
    border-color: #333;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.otm-popup-form .otm-submit-btn {
    width: 100%;
    padding: 16px 24px;
    background: #1a1a1a;
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    margin-top: 8px;
}

.otm-popup-form .otm-submit-btn:hover {
    background: #333;
    transform: translateY(-1px);
}

.otm-popup-form .otm-submit-btn:disabled {
    background: #999;
    cursor: not-allowed;
    transform: none;
}

.otm-popup-loading {
    display: none;
    text-align: center;
    padding: 40px 20px;
}

.otm-popup-loading.active {
    display: block;
}

.otm-popup-result {
    display: none;
    overflow-y: auto;
    flex: 1 1 auto;
}

.otm-popup-result.active {
    display: block;
}

.otm-popup-form.hidden {
    display: none;
}

/* Debug Panel */
.otm-debug-panel {
    margin-top: 12px;
    padding: 8px 10px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    background: #f8f8f8;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
    line-height: 1.4;
    max-height: 160px;
    overflow: auto;
}

.otm-debug-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    gap: 8px;
}

.otm-debug-title {
    font-weight: 600;
}

.otm-debug-copy {
    border: 1px solid rgba(0, 0, 0, 0.2);
    background: #fff;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    cursor: pointer;
}

.otm-debug-copy:disabled {
    opacity: 0.6;
    cursor: default;
}

.otm-debug-line {
    white-space: pre-wrap;
}

/* Responsive */
@media (max-width: 640px) {
    .otm-popup-overlay {
        padding: 10px;
    }
    
    .otm-popup-container {
        max-height: 95vh;
    }
    
    .otm-popup-inner {
        padding: 24px !important;
    }
}
