/* ============================================================
   SBL Document Builder — Frontend Styles
   Rocket Lawyer-style split-screen builder
   ============================================================ */

/* ── Library Grid ── */
.sbl-library {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}
.sbl-library-header {
    text-align: center;
    margin-bottom: 40px;
}
.sbl-library-header h2 {
    font-size: 2rem;
    color: #1a1a2e;
    margin-bottom: 10px;
}
.sbl-library-header p {
    font-size: 1.05rem;
    color: #555;
}
.sbl-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}
.sbl-doc-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 28px 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.sbl-doc-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
.sbl-doc-card-icon {
    font-size: 2.2rem;
}
.sbl-doc-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}
.sbl-doc-card p {
    font-size: 0.9rem;
    color: #666;
    flex-grow: 1;
    margin: 0;
}
.sbl-btn-start {
    display: inline-block;
    background: #c0392b;
    color: #fff !important;
    padding: 10px 18px;
    border-radius: 6px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    transition: background 0.2s;
    margin-top: 6px;
}
.sbl-btn-start:hover {
    background: #a93226;
}

/* ── Builder Layout ── */
.sbl-builder {
    display: flex;
    align-items: flex-start;
    gap: 0;
    min-height: 100vh;
    max-width: 100%;
}

/* LEFT: Form */
.sbl-builder-form-panel {
    width: 42%;
    min-width: 340px;
    background: #fff;
    border-right: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.sbl-form-header {
    background: #1a1a2e;
    color: #fff;
    padding: 24px 28px 18px;
    border-bottom: 3px solid #c0392b;
}
.sbl-form-header h2 {
    color: #fff;
    font-size: 1.2rem;
    margin: 0 0 6px;
}
.sbl-price-badge {
    font-size: 0.85rem;
    color: #f8c291;
    margin: 0;
}
.sbl-form-body {
    padding: 24px 28px;
    flex-grow: 1;
}

/* Formidable overrides inside builder */
.sbl-builder-form-panel .frm_forms input[type="text"],
.sbl-builder-form-panel .frm_forms input[type="email"],
.sbl-builder-form-panel .frm_forms input[type="number"],
.sbl-builder-form-panel .frm_forms input[type="tel"],
.sbl-builder-form-panel .frm_forms select,
.sbl-builder-form-panel .frm_forms textarea {
    width: 100%;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    padding: 9px 12px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.sbl-builder-form-panel .frm_forms input:focus,
.sbl-builder-form-panel .frm_forms select:focus,
.sbl-builder-form-panel .frm_forms textarea:focus {
    border-color: #c0392b;
    outline: none;
    box-shadow: 0 0 0 2px rgba(192,57,43,0.15);
}
.sbl-builder-form-panel .frm_forms label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #333;
    margin-bottom: 4px;
    display: block;
}
.sbl-builder-form-panel .frm_forms .frm_description {
    font-size: 0.78rem;
    color: #888;
    margin-top: 2px;
}
.sbl-builder-form-panel .frm_forms .frm_submit {
    display: none; /* We replace submit with the payment button */
}
.sbl-builder-form-panel .frm_forms .frm_section_heading {
    background: #f7f7f7;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 18px 0 10px;
    border-left: 3px solid #c0392b;
}

/* Payment Section */
.sbl-payment-section {
    padding: 20px 28px 28px;
    background: #fafafa;
    border-top: 1px solid #eee;
}
.sbl-payment-box {
    background: #fff;
    border: 2px solid #c0392b;
    border-radius: 10px;
    padding: 20px;
}
.sbl-payment-box h3 {
    font-size: 1rem;
    color: #1a1a2e;
    margin: 0 0 6px;
}
.sbl-payment-box p {
    font-size: 0.85rem;
    color: #666;
    margin: 0 0 12px;
}
.sbl-email-input {
    width: 100%;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 0.9rem;
    margin-bottom: 12px;
    box-sizing: border-box;
}
.sbl-btn-pay {
    width: 100%;
    background: #c0392b;
    color: #fff;
    border: none;
    padding: 13px;
    border-radius: 7px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}
.sbl-btn-pay:hover {
    background: #a93226;
}
.sbl-secure-note {
    font-size: 0.75rem;
    color: #999;
    text-align: center;
    margin-top: 10px !important;
}

/* RIGHT: Preview */
.sbl-builder-preview-panel {
    width: 58%;
    min-height: 100vh;
    background: #f4f4f8;
    display: flex;
    flex-direction: column;
}
.sbl-preview-header {
    background: #2c3e50;
    color: #fff;
    padding: 14px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 5;
}
.sbl-preview-label {
    font-weight: 700;
    font-size: 0.9rem;
}
.sbl-preview-note {
    font-size: 0.78rem;
    color: #aab7c4;
}
.sbl-preview-body {
    padding: 40px 48px;
    flex-grow: 1;
    overflow-y: auto;
}

/* Document Styles inside Preview */
.sbl-doc {
    background: #fff;
    padding: 48px 52px;
    max-width: 780px;
    margin: 0 auto;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    border-radius: 4px;
    font-family: 'Georgia', serif;
    font-size: 10.5pt;
    line-height: 1.65;
    color: #1a1a1a;
    position: relative;
}
.sbl-doc-title {
    text-align: center;
    font-size: 14pt;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 28px;
    padding-bottom: 14px;
    border-bottom: 2px solid #1a1a2e;
    color: #1a1a2e;
}
.sbl-doc h2 {
    font-size: 10.5pt;
    font-weight: 700;
    margin: 18px 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #1a1a2e;
}
.sbl-doc p {
    margin: 6px 0;
}
.sbl-doc table.sbl-sig-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 28px;
}
.sbl-doc table.sbl-sig-table td {
    width: 50%;
    vertical-align: top;
    padding: 14px;
    border: 1px solid #ccc;
    font-size: 9.5pt;
}
.sbl-doc .sbl-url-block {
    font-family: 'Courier New', monospace;
    background: #f5f5f5;
    padding: 10px;
    border-radius: 4px;
    font-size: 9pt;
    word-break: break-all;
}

/* Placeholder vs filled fields */
.sbl-placeholder {
    color: #bbb;
    font-style: italic;
    border-bottom: 1px dashed #ccc;
}
.sbl-filled {
    color: #1a1a2e;
    font-weight: 500;
    border-bottom: 1px solid #c0392b;
    transition: color 0.2s;
}

/* Watermark wrapper */
.sbl-doc-watermark-wrapper {
    position: relative;
}
.sbl-watermark-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    background-image: url('https://standbylawyer.com/wp-content/uploads/2026/06/STANDBY-LAWYER-tranparent-logo-high-def.webp');
    background-repeat: repeat;
    background-size: 260px auto;
    opacity: 0.10;
}

/* Loading overlay */
.sbl-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sbl-overlay-inner {
    background: #fff;
    border-radius: 12px;
    padding: 40px 48px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.sbl-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top-color: #c0392b;
    border-radius: 50%;
    animation: sbl-spin 0.75s linear infinite;
    margin: 0 auto 16px;
}
@keyframes sbl-spin {
    to { transform: rotate(360deg); }
}

/* Errors */
.sbl-error {
    color: #c0392b;
    padding: 12px;
    border: 1px solid #c0392b;
    border-radius: 6px;
    background: #fdf0ee;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .sbl-builder {
        flex-direction: column;
    }
    .sbl-builder-form-panel,
    .sbl-builder-preview-panel {
        width: 100%;
        min-width: unset;
        position: static;
        height: auto;
    }
    .sbl-builder-form-panel {
        border-right: none;
        border-bottom: 2px solid #e0e0e0;
    }
    .sbl-doc {
        padding: 28px 24px;
    }
    .sbl-preview-body {
        padding: 20px 16px;
    }
}
