/* ============================================
   WP Document Optin – Modal Styles
   ============================================ */
:root {
    --wpdoc-primary:   #4F46E5;
    --wpdoc-primary-d: #4338CA;
    --wpdoc-accent:    #7C3AED;
    --wpdoc-success:   #10B981;
    --wpdoc-danger:    #EF4444;
    --wpdoc-text:      #111827;
    --wpdoc-muted:     #6B7280;
    --wpdoc-border:    #E5E7EB;
    --wpdoc-bg:        #F9FAFB;
    --wpdoc-radius:    14px;
    --wpdoc-shadow:    0 20px 60px rgba(0,0,0,.18);
    --wpdoc-duration:  .28s;
}

/* ── Trigger button ──────────────────────── */
.wpdoc-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    background: var(--wpdoc-primary);
    color: #fff !important;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none !important;
    cursor: pointer;
    transition: background var(--wpdoc-duration), transform .12s;
    border: none;
}
.wpdoc-trigger-btn:hover {
    background: var(--wpdoc-primary-d);
    transform: translateY(-1px);
}
.wpdoc-btn-icon { font-size: 18px; line-height: 1; }

/* ── Overlay ─────────────────────────────── */
.wpdoc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.55);
    backdrop-filter: blur(4px);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity var(--wpdoc-duration);
    pointer-events: none;
}
.wpdoc-overlay.wpdoc-open {
    opacity: 1;
    pointer-events: all;
}

/* ── Modal box ───────────────────────────── */
.wpdoc-modal {
    background: #fff;
    border-radius: var(--wpdoc-radius);
    box-shadow: var(--wpdoc-shadow);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(20px) scale(.97);
    transition: transform var(--wpdoc-duration);
}
.wpdoc-overlay.wpdoc-open .wpdoc-modal {
    transform: translateY(0) scale(1);
}

/* ── Header ──────────────────────────────── */
.wpdoc-modal-header {
    background: linear-gradient(135deg, var(--wpdoc-primary) 0%, var(--wpdoc-accent) 100%);
    padding: 22px 24px 20px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}
.wpdoc-modal-header-text { flex: 1; }
.wpdoc-modal-header h2 {
    color: #fff;
    font-size: 19px;
    font-weight: 700;
    margin: 0 0 6px;
    line-height: 1.25;
}
/* Progress indicator */
.wpdoc-steps {
    display: flex;
    align-items: center;
    gap: 6px;
}
.wpdoc-step-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,.35);
    transition: background var(--wpdoc-duration), width var(--wpdoc-duration);
}
.wpdoc-step-dot.active {
    background: #fff;
    width: 22px;
    border-radius: 4px;
}
.wpdoc-close-btn {
    background: rgba(255,255,255,.2);
    border: none;
    color: #fff;
    width: 32px; height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: background .15s;
}
.wpdoc-close-btn:hover { background: rgba(255,255,255,.35); }

/* ── Body ────────────────────────────────── */
.wpdoc-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}
.wpdoc-step { display: none; }
.wpdoc-step.active { display: block; }

.wpdoc-step-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--wpdoc-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin: 0 0 16px;
}

/* ── Document checkboxes ─────────────────── */
.wpdoc-doc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.wpdoc-doc-item {
    display: flex;
    align-items: center;
    gap: 14px;
    border: 2px solid var(--wpdoc-border);
    border-radius: 10px;
    padding: 14px 16px;
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s;
    position: relative;
}
.wpdoc-doc-item:hover { border-color: var(--wpdoc-primary); background: #f5f4ff; }
.wpdoc-doc-item.checked {
    border-color: var(--wpdoc-primary);
    background: #eeecff;
    box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.wpdoc-doc-item input[type="checkbox"] {
    display: none;
}
.wpdoc-checkbox-custom {
    width: 22px; height: 22px;
    border: 2px solid var(--wpdoc-border);
    border-radius: 6px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: border-color .15s, background .15s;
    background: #fff;
}
.wpdoc-doc-item.checked .wpdoc-checkbox-custom {
    background: var(--wpdoc-primary);
    border-color: var(--wpdoc-primary);
}
.wpdoc-checkbox-custom::after {
    content: '';
    width: 5px; height: 9px;
    border: 2px solid transparent;
    border-top: none; border-left: none;
    transform: rotate(45deg) translateY(-1px);
    opacity: 0;
    transition: opacity .15s;
}
.wpdoc-doc-item.checked .wpdoc-checkbox-custom::after {
    border-color: #fff;
    opacity: 1;
}
.wpdoc-doc-thumb {
    width: 44px; height: 44px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--wpdoc-bg);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.wpdoc-doc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.wpdoc-doc-thumb-icon { font-size: 22px; color: var(--wpdoc-primary); }
.wpdoc-doc-info { flex: 1; min-width: 0; }
.wpdoc-doc-title { font-size: 14px; font-weight: 600; color: var(--wpdoc-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wpdoc-doc-desc  { font-size: 12px; color: var(--wpdoc-muted); margin-top: 2px; }
.wpdoc-doc-ext   {
    font-size: 11px; font-weight: 700; letter-spacing: .04em;
    background: var(--wpdoc-primary); color: #fff;
    padding: 2px 6px; border-radius: 4px; flex-shrink: 0;
}

/* ── Form fields ─────────────────────────── */
.wpdoc-form { display: flex; flex-direction: column; gap: 14px; }
.wpdoc-field-group { display: flex; flex-direction: column; gap: 5px; }
.wpdoc-field-group label { font-size: 13px; font-weight: 600; color: var(--wpdoc-text); }
.wpdoc-field-group input,
.wpdoc-field-group select {
    padding: 11px 14px;
    border: 1.5px solid var(--wpdoc-border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--wpdoc-text);
    width: 100%;
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
    background: #fff;
}
.wpdoc-field-group input:focus,
.wpdoc-field-group select:focus {
    border-color: var(--wpdoc-primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.wpdoc-field-group input.wpdoc-error { border-color: var(--wpdoc-danger); }
.wpdoc-field-error { font-size: 12px; color: var(--wpdoc-danger); margin-top: 2px; display: none; }
.wpdoc-field-group.has-error .wpdoc-field-error { display: block; }

/* Consent */
.wpdoc-consent-wrap {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: var(--wpdoc-bg);
    border: 1px solid var(--wpdoc-border);
    border-radius: 8px;
    padding: 12px 14px;
}
.wpdoc-consent-wrap input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; accent-color: var(--wpdoc-primary); }
.wpdoc-consent-wrap label { font-size: 12px; color: var(--wpdoc-muted); line-height: 1.5; cursor: pointer; }

/* Honeypot */
.wpdoc-hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

/* ── Footer / buttons ────────────────────── */
.wpdoc-modal-footer {
    padding: 16px 24px 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-top: 1px solid var(--wpdoc-border);
    flex-shrink: 0;
    background: #fff;
}
.wpdoc-btn {
    padding: 11px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background .15s, transform .1s;
    display: inline-flex; align-items: center; gap: 6px;
}
.wpdoc-btn:active { transform: scale(.97); }
.wpdoc-btn-primary {
    background: var(--wpdoc-primary);
    color: #fff;
}
.wpdoc-btn-primary:hover { background: var(--wpdoc-primary-d); }
.wpdoc-btn-primary:disabled { background: #a5b4fc; cursor: not-allowed; }
.wpdoc-btn-ghost {
    background: transparent;
    color: var(--wpdoc-muted);
    border: 1.5px solid var(--wpdoc-border);
}
.wpdoc-btn-ghost:hover { background: var(--wpdoc-bg); }

/* ── Success screen ──────────────────────── */
.wpdoc-success {
    text-align: center;
    padding: 20px 0 8px;
}
.wpdoc-success-icon {
    width: 64px; height: 64px;
    background: #d1fae5;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 30px;
    margin: 0 auto 16px;
    animation: wpdoc-pop .4s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes wpdoc-pop {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.wpdoc-success h3 { font-size: 20px; color: var(--wpdoc-text); margin: 0 0 8px; }
.wpdoc-success p  { font-size: 14px; color: var(--wpdoc-muted); margin: 0; }

/* ── Spinner ─────────────────────────────── */
.wpdoc-spinner {
    width: 18px; height: 18px;
    border: 2.5px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wpdoc-spin .7s linear infinite;
}
@keyframes wpdoc-spin { to { transform: rotate(360deg); } }

/* ── Responsive ──────────────────────────── */
@media (max-width: 540px) {
    .wpdoc-modal { border-radius: 12px 12px 0 0; max-height: 92vh; margin-top: auto; }
    .wpdoc-overlay { align-items: flex-end; padding: 0; }
}
