/* Consolidated from templates/layout.html inline <style> blocks: third-party widget
   and component overrides (Zoho popup, footer subscribe form, lead-magnet book popup). */

/* ── Zoho popup responsive overrides ── */
        #zc_popoverlay * {
            box-sizing: border-box !important;
        }
        #zc_popoverlay > div {
            width: 100% !important;
        }
        #zc_popoverlay > div > div {
            padding: 10px !important;
        }
        #signUpFormInline {
            overflow-x: hidden !important;
            max-width: 100% !important;
            width: 100% !important;
            margin: 0 auto !important;
        }
        #signUpFormInline input[type="text"],
        #signUpFormInline input[type="email"],
        #signUpFormInline textarea,
        #signUpFormInline select {
            max-width: 100% !important;
            width: 100% !important;
        }
        #signUpFormInline img {
            max-width: 100% !important;
            height: auto !important;
        }
        #signUpFormInline > div,
        #signUpFormInline > form,
        #signUpFormInline > form > div {
            max-width: 100% !important;
        }
        @media (min-width: 768px) {
            #signUpFormInline {
                max-width: 600px !important;
            }
        }

/* ── Footer subscribe form ── */
    /* Footer form - base styles */
    .footer-subscribe-form {
        display: flex;
        flex-direction: row;
        gap: 8px;
        align-items: center;
    }
    
    /* Mobile and tablet - stacked centered */
    @media (max-width: 1024px) {
        .footer-newsletter {
            text-align: center !important;
        }
        .footer-subscribe-form {
            flex-direction: column !important;
            align-items: center !important;
            justify-content: center !important;
            max-width: 400px !important;
            margin: 0 auto !important;
        }
        .footer-subscribe-form input {
            width: 100% !important;
            max-width: 400px !important;
        }
        .footer-subscribe-form button {
            width: 100% !important;
            max-width: 400px !important;
            margin-top: 8px;
        }
        .footer-cta-button {
            display: block !important;
            margin: 20px auto 0 !important;
            text-align: center !important;
        }
    }

/* ── Lead-magnet book popup ── */
        .book-popup {
            display: none;
            position: fixed;
            inset: 0;
            z-index: 2000;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }
        
        .book-popup.active {
            display: flex;
        }
        
        .book-popup-overlay {
            position: absolute;
            inset: 0;
            background: rgba(15, 23, 42, 0.8);
            backdrop-filter: blur(4px);
        }
        
        .book-popup-content {
            position: relative;
            background: var(--surface, #ffffff);
            border: 2px solid var(--ink, #0f172a);
            box-shadow: 12px 12px 0 var(--ink, #0f172a);
            max-width: 700px;
            width: 100%;
            animation: popupSlideIn 0.4s ease;
        }
        
        @keyframes popupSlideIn {
            from {
                opacity: 0;
                transform: translateY(20px) scale(0.95);
            }
            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }
        
        .book-popup-close {
            position: absolute;
            top: 16px;
            right: 16px;
            background: none;
            border: none;
            cursor: pointer;
            color: var(--ink, #0f172a);
            z-index: 10;
            padding: 4px;
            transition: color 0.2s;
        }
        
        .book-popup-close:hover {
            color: var(--accent, #f59e0b);
        }
        
        .book-popup-grid {
            display: grid;
            grid-template-columns: 200px 1fr;
            gap: 0;
        }
        
        .book-popup-left {
            background: var(--ink, #0f172a);
            padding: 40px 24px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 24px;
        }
        
        .book-cover-wrapper {
            position: relative;
            width: 140px;
            height: 180px;
            perspective: 600px;
        }
        
        .book-cover-spine {
            position: absolute;
            left: 0;
            top: 0;
            width: 20px;
            height: 100%;
            background: linear-gradient(to right, #1e293b, #334155);
            border-radius: 2px 0 0 2px;
        }
        
        .book-cover-front {
            position: absolute;
            left: 20px;
            top: 0;
            width: 120px;
            height: 100%;
            background: linear-gradient(135deg, var(--accent, #f59e0b) 0%, #d97706 100%);
            border-radius: 0 3px 3px 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 16px;
            text-align: center;
            box-shadow: 4px 4px 12px rgba(0,0,0,0.3);
        }
        
        .book-icon {
            font-size: 2.5rem;
            margin-bottom: 8px;
        }
        
        .book-title {
            font-family: 'Playfair Display', serif;
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--ink, #0f172a);
            line-height: 1.2;
            margin: 0;
        }
        
        .book-author {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.6rem;
            letter-spacing: 0.1em;
            text-transform: uppercase;
            color: var(--ink, #0f172a);
            opacity: 0.8;
            margin: 8px 0 0;
        }
        
        .trust-badge {
            text-align: center;
            color: var(--bg, #f8fafc);
        }
        
        .trust-number {
            display: block;
            font-family: 'Playfair Display', serif;
            font-size: 1.8rem;
            font-weight: 900;
            color: var(--accent, #f59e0b);
            line-height: 1;
        }
        
        .trust-text {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.65rem;
            letter-spacing: 0.15em;
            text-transform: uppercase;
            opacity: 0.7;
        }
        
        .book-popup-right {
            padding: 40px;
            display: flex;
            flex-direction: column;
        }
        
        .book-label {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.65rem;
            letter-spacing: 0.22em;
            text-transform: uppercase;
            color: var(--accent, #f59e0b);
            margin-bottom: 12px;
        }
        
        .book-headline {
            font-family: 'Playfair Display', serif;
            font-size: 1.8rem;
            font-weight: 900;
            color: var(--ink, #0f172a);
            line-height: 1.1;
            margin-bottom: 16px;
            letter-spacing: -0.02em;
        }
        
        .book-headline em {
            font-style: italic;
            color: var(--accent, #f59e0b);
        }
        
        .book-description {
            font-size: 0.9rem;
            color: var(--muted, #475569);
            line-height: 1.6;
            margin-bottom: 20px;
        }
        
        /* Lead Form Styles */
        .lead-form {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }
        
        .form-group {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }
        
        .form-label {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.65rem;
            letter-spacing: 0.1em;
            text-transform: uppercase;
            color: var(--ink, #0f172a);
            font-weight: 500;
        }
        
        .form-input {
            padding: 12px 16px;
            border: 2px solid var(--border, #e2e8f0);
            font-family: 'Syne', sans-serif;
            font-size: 0.9rem;
            color: var(--ink, #0f172a);
            background: var(--surface, #ffffff);
            transition: border-color 0.2s, box-shadow 0.2s;
        }
        
        .form-input:focus {
            outline: none;
            border-color: var(--accent, #f59e0b);
            box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
        }
        
        .form-input.error {
            border-color: #dc2626;
            background-color: rgba(220, 38, 38, 0.05);
        }
        
        .form-input.error:focus {
            box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
        }
        
        .error-message {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.65rem;
            color: #dc2626;
            display: none;
            margin-top: 4px;
        }
        
        .error-message.visible {
            display: block;
        }
        
        .form-actions {
            display: flex;
            gap: 12px;
            margin-top: 8px;
            flex-wrap: wrap;
        }
        
        .form-actions .btn-ink,
        .form-actions .btn-outline-ink {
            font-size: 10px;
            padding: 12px 20px;
            flex: 1;
            min-width: 140px;
        }
        
        .btn-submit {
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }
        
        .btn-submit.loading .btn-text {
            opacity: 0;
        }
        
        .btn-submit.loading .btn-loader {
            display: block;
        }
        
        .btn-loader {
            display: none;
            width: 16px;
            height: 16px;
            border: 2px solid transparent;
            border-top-color: currentColor;
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
            position: absolute;
        }
        
        @keyframes spin {
            to { transform: rotate(360deg); }
        }
        
        .privacy-note {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.6rem;
            letter-spacing: 0.08em;
            color: var(--muted, #475569);
            margin-top: 16px;
            padding-top: 16px;
            border-top: 1px solid var(--border, #e2e8f0);
        }
        
        /* Success View Styles */
        .success-view {
            text-align: center;
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        
        .success-icon {
            width: 60px;
            height: 60px;
            background: var(--accent2, #14b8a6);
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 2rem;
            margin: 20px 0;
            animation: scaleIn 0.4s ease;
        }
        
        @keyframes scaleIn {
            from {
                opacity: 0;
                transform: scale(0);
            }
            to {
                opacity: 1;
                transform: scale(1);
            }
        }
        
        .success-actions {
            display: flex;
            flex-direction: column;
            gap: 12px;
            width: 100%;
        }
        
        .btn-download {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }
        
        .btn-download .material-icons {
            font-size: 18px;
        }
        
        .book-cover-image {
            width: 160px;
            height: 220px;
            border-radius: 4px;
            overflow: hidden;
            box-shadow: 8px 8px 20px rgba(0,0,0,0.4);
            background: linear-gradient(135deg, var(--accent, #f59e0b) 0%, #d97706 100%);
        }
        
        .book-cover-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }
        
        /* Mobile Responsive */
        @media (max-width: 640px) {
            .book-popup {
                padding: 0;
                align-items: flex-end;
            }
            
            .book-popup-content {
                max-width: 100%;
                max-height: 75vh;
                min-height: auto;
                overflow-y: auto;
                border-radius: 16px 16px 0 0;
                box-shadow: 0 -8px 32px rgba(0,0,0,0.4);
                animation: popupSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
                margin: 0;
                border: none;
                border-top: 3px solid var(--accent, #f59e0b);
            }
            
            @keyframes popupSlideUp {
                from {
                    opacity: 0;
                    transform: translateY(100%);
                }
                to {
                    opacity: 1;
                    transform: translateY(0);
                }
            }
            
            .book-popup-grid {
                grid-template-columns: 1fr;
                gap: 0;
            }
            
            .book-popup-left {
                padding: 16px;
                flex-direction: row;
                justify-content: center;
                align-items: center;
                gap: 14px;
                min-height: auto;
                background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
            }

            .book-cover-image {
                width: 72px;
                height: 100px;
                flex-shrink: 0;
            }
            
            .trust-badge {
                flex-direction: column;
                gap: 2px;
                align-items: flex-start;
            }
            
            .trust-number {
                font-size: 0.9rem;
                letter-spacing: 0.05em;
            }
            
            .trust-text {
                font-size: 8px;
                letter-spacing: 0.15em;
            }
            
            .book-popup-right {
                padding: 16px 20px 20px;
            }
            
            .book-headline {
                font-size: 1.1rem;
                margin-bottom: 8px;
            }
            
            .book-desc {
                font-size: 0.85rem;
                margin-bottom: 16px;
                line-height: 1.5;
            }
            
            .book-label {
                font-size: 9px;
                margin-bottom: 8px;
            }
            
            .book-popup-close {
                top: 8px;
                right: 8px;
                background: rgba(255,255,255,0.95);
                border-radius: 50%;
                width: 32px;
                height: 32px;
                z-index: 100;
                box-shadow: 0 2px 8px rgba(0,0,0,0.2);
            }
            
            .book-popup-close .material-icons {
                font-size: 18px;
            }
            
            .form-actions {
                flex-direction: column;
                gap: 8px;
                margin-top: 12px;
            }
            
            .form-actions .btn-ink,
            .form-actions .btn-outline-ink {
                width: 100%;
                padding: 10px 14px;
                font-size: 12px;
                min-height: 44px;
            }
            
            .form-group {
                margin-bottom: 12px;
            }
            
            .input-ink {
                padding: 10px 12px;
                font-size: 16px;
                min-height: 44px;
            }
            
            .privacy-note {
                font-size: 10px;
                margin-top: 12px;
            }
            
            /* Success view on mobile */
            .success-view h3 {
                font-size: 1.1rem;
            }
            
            .success-view p {
                font-size: 0.85rem;
            }
        }
        
        @media (max-width: 480px) {
            .book-popup-content {
                max-height: 80vh;
            }
            
            .book-popup-right {
                padding: 14px 16px 18px;
            }
            
            .book-headline {
                font-size: 1rem;
            }
            
            .book-popup-left {
                padding: 12px 14px;
            }

            .book-cover-image {
                width: 60px;
                height: 84px;
            }
            
            .trust-number {
                font-size: 0.85rem;
            }
        }
        
        @media (max-width: 360px) {
            .book-popup-right {
                padding: 12px 14px 16px;
            }
            
            .book-headline {
                font-size: 0.95rem;
            }
            
            .book-desc {
                font-size: 0.8rem;
            }
        }
