/* Obsium Whitepaper Leads — frontend styles (theme-isolated, mobile + desktop) */

/* ============================================
 * Default plugin button (when used via shortcode without custom HTML)
 * ============================================ */
.owl-default-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: #fff;
    color: #111827;
    font-size: 15px;
    font-weight: 500;
    border-radius: 999px;
    border: 1.5px solid #d1d5db;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s ease, color 0.15s ease;
}
.owl-default-button:hover {
    border-color: #7c3aed;
    color: #7c3aed;
}
.owl-default-button svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ============================================
 * Modal container — high-specificity reset
 * ============================================ */

.owl-modal[hidden] { display: none !important; }

.owl-modal,
.owl-modal * {
    box-sizing: border-box;
}

.owl-modal {
    position: fixed;
    inset: 0;
    /* Maximum 32-bit signed int — guarantees this beats any theme/plugin element */
    z-index: 2147483647;
    /* Create our own stacking context */
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overscroll-behavior: contain;
    -webkit-tap-highlight-color: transparent;
    line-height: 1.5;
}

.owl-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.6);
    cursor: pointer;
    z-index: 1;
    animation: owl-fade 0.2s ease-out;
}

@keyframes owl-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.owl-modal__panel {
    position: relative;
    z-index: 2;
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: owl-pop 0.18s ease-out;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@keyframes owl-pop {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================
 * Lock SVG sizes hard — themes love to set svg { width: 100% }
 * which blows up our icons. Override every SVG inside the modal.
 * ============================================ */
.owl-modal svg,
.owl-default-button svg {
    max-width: none !important;
    height: auto;
    flex-shrink: 0;
    vertical-align: middle;
    display: inline-block;
}

/* Specific SVG sizes — explicit, themes can't override */
.owl-modal__icon {
    margin: 0 0 16px;
    line-height: 0;
    display: block;
}
.owl-modal__icon svg {
    width: 28px !important;
    height: 28px !important;
    display: block;
}

.owl-modal__close svg {
    width: 20px !important;
    height: 20px !important;
    display: block;
}

.owl-modal__submit svg {
    width: 14px !important;
    height: 14px !important;
}

/* ============================================
 * Close button
 * ============================================ */
.owl-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: #6b7280;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    /* Reset theme button styles */
    box-shadow: none;
    text-decoration: none;
    text-transform: none;
    letter-spacing: normal;
    font-family: inherit;
    font-size: 0;
    min-width: 0;
    min-height: 0;
}
.owl-modal__close:hover { color: #111827; background: #f3f4f6; }
.owl-modal__close:focus-visible {
    outline: 2px solid #7c3aed;
    outline-offset: 2px;
}

/* ============================================
 * Typography
 * ============================================ */
.owl-modal__title {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 6px;
    line-height: 1.35;
    padding-right: 36px;
    /* Defend against theme heading styles */
    letter-spacing: normal;
    text-transform: none;
    font-family: inherit;
}

.owl-modal__sub {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.6;
    margin: 0 0 20px;
    padding: 0;
    font-family: inherit;
}

/* ============================================
 * Form fields
 * ============================================ */
.owl-form { margin: 0; padding: 0; }
.owl-form .owl-field { margin: 0 0 14px; }
.owl-form .owl-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin: 0 0 6px;
    padding: 0;
    font-family: inherit;
    text-transform: none;
    letter-spacing: normal;
}
.owl-form .owl-field input,
.owl-modal input[type="text"],
.owl-modal input[type="email"] {
    width: 100% !important;
    max-width: 100%;
    padding: 12px 14px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 8px !important;
    /* 16px prevents iOS Safari from auto-zooming when focusing */
    font-size: 16px !important;
    line-height: 1.5 !important;
    font-family: inherit !important;
    outline: none !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    background: #fff !important;
    color: #111827 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    text-transform: none;
    letter-spacing: normal;
    display: block;
}
.owl-form .owl-field input:focus,
.owl-modal input[type="text"]:focus,
.owl-modal input[type="email"]:focus {
    border-color: #7c3aed !important;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12) !important;
}

/* Honeypot — visually hidden but available to bots */
.owl-hp {
    position: absolute;
    left: -9999px;
    top: -9999px;
    height: 0;
    width: 0;
    overflow: hidden;
}

/* ============================================
 * Submit button — defended against theme button styles
 * ============================================ */
.owl-modal__submit {
    margin: 6px 0 0;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, #7c3aed, #3b82f6) !important;
    color: #fff !important;
    font-size: 15px;
    font-weight: 500;
    border-radius: 999px !important;
    border: none !important;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.4;
    transition: opacity 0.15s ease, transform 0.05s ease;
    touch-action: manipulation;
    min-height: 48px;
    text-transform: none;
    letter-spacing: normal;
    text-decoration: none;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}
.owl-modal__submit:hover { opacity: 0.9; }
.owl-modal__submit:active { transform: scale(0.99); }
.owl-modal__submit:disabled { opacity: 0.6; cursor: not-allowed; }
.owl-modal__submit:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -4px;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.4);
}

.owl-modal__msg {
    font-size: 13px;
    text-align: center;
    margin: 12px 0 0;
    min-height: 18px;
    line-height: 1.5;
    font-family: inherit;
}
.owl-modal__msg.is-error   { color: #b91c1c; }
.owl-modal__msg.is-success { color: #047857; }

.owl-modal__legal {
    font-size: 12px;
    color: #6b7280;
    text-align: center;
    margin: 12px 0 0;
    line-height: 1.5;
    font-family: inherit;
}

/* ============================================
 * Mobile — phones up to 480px (bottom-sheet style)
 * ============================================ */
@media (max-width: 480px) {
    .owl-modal {
        padding: 12px;
        align-items: flex-end;
    }
    .owl-modal__panel {
        padding: 24px 20px 22px;
        border-radius: 16px;
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
        animation: owl-slide-up 0.22s ease-out;
    }
    @keyframes owl-slide-up {
        from { opacity: 0; transform: translateY(20px); }
        to   { opacity: 1; transform: translateY(0); }
    }
    .owl-modal__title    { font-size: 18px; padding-right: 32px; }
    .owl-modal__sub      { font-size: 13.5px; margin-bottom: 18px; }
    .owl-modal__icon svg { width: 24px !important; height: 24px !important; }
    .owl-modal__close    { top: 8px; right: 8px; }
}

/* ============================================
 * Landscape phones — limit height, allow scroll
 * ============================================ */
@media (max-height: 500px) and (orientation: landscape) {
    .owl-modal { align-items: center; padding: 12px; }
    .owl-modal__panel {
        padding: 20px 24px;
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
    }
    .owl-modal__icon  { margin-bottom: 8px; }
    .owl-modal__title { font-size: 17px; margin-bottom: 4px; }
    .owl-modal__sub   { font-size: 13px; margin-bottom: 14px; }
    .owl-form .owl-field { margin-bottom: 10px; }
}

/* ============================================
 * Reduced motion
 * ============================================ */
@media (prefers-reduced-motion: reduce) {
    .owl-modal__panel,
    .owl-modal__backdrop {
        animation: none !important;
    }
    .owl-modal__submit { transition: none; }
}
