/**
 * Bryze PDF Sign — Mobile Styles
 * Only visible on < 768px, desktop is unaffected
 */

/* Hide mobile app on desktop */
.bps-mobile-app {
    display: none;
}

@media (max-width: 768px) {
    /* Show mobile, hide desktop */
    .bps-mobile-app {
        display: block;
        max-width: 100%;
        padding: 0;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
        color: #1e293b;
    }
    .bps-desktop-only {
        display: none !important;
    }

    /* Header */
    .bpsm-header {
        background: linear-gradient(135deg, #1a1a2e, #16213e);
        color: white;
        padding: 24px 20px;
        text-align: center;
    }
    .bpsm-header h2 {
        font-size: 1.2rem;
        font-weight: 700;
        margin: 0 0 4px;
    }
    .bpsm-header p {
        font-size: 0.85rem;
        color: #94a3b8;
        margin: 0;
    }

    /* PDF Viewer */
    .bpsm-viewer {
        background: #f1f5f9;
        padding: 8px;
        text-align: center;
        min-height: 200px;
    }
    .bpsm-viewer canvas {
        max-width: 100%;
        height: auto;
        border-radius: 4px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    /* Page nav */
    .bpsm-pagenav {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 16px;
        padding: 12px 20px;
        background: #fff;
        border-bottom: 1px solid #e2e8f0;
    }
    .bpsm-nav-btn {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        border: 1px solid #e2e8f0;
        background: #fff;
        font-size: 18px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #1e293b;
        transition: all 0.15s;
    }
    .bpsm-nav-btn:disabled {
        opacity: 0.3;
        cursor: default;
    }
    .bpsm-nav-btn:not(:disabled):active {
        background: #f1f5f9;
    }
    #bpsm-pageinfo {
        font-size: 0.85rem;
        font-weight: 600;
        color: #64748b;
        min-width: 100px;
        text-align: center;
    }

    /* Sign panel */
    .bpsm-sign-panel {
        padding: 20px;
        background: #fff;
    }
    .bpsm-sign-panel h3 {
        font-size: 1.1rem;
        font-weight: 700;
        margin: 0 0 16px;
        color: #1e293b;
    }
    .bpsm-label {
        display: block;
        font-size: 0.8rem;
        font-weight: 600;
        color: #64748b;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin: 16px 0 6px;
    }
    .bpsm-label:first-of-type {
        margin-top: 0;
    }
    .bpsm-input {
        width: 100%;
        padding: 12px 14px;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        font-size: 16px; /* Prevents iOS zoom */
        font-family: inherit;
        color: #1e293b;
        background: #f8fafc;
        -webkit-appearance: none;
    }
    .bpsm-input:focus {
        outline: none;
        border-color: #667eea;
        box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
    }

    /* Font options */
    .bpsm-font-options {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .bpsm-font-btn {
        padding: 12px 8px;
        border: 2px solid #e2e8f0;
        border-radius: 10px;
        background: #fff;
        cursor: pointer;
        text-align: center;
        transition: all 0.15s;
    }
    .bpsm-font-btn span {
        font-size: 20px;
        display: block;
        min-height: 28px;
        line-height: 28px;
    }
    .bpsm-font-btn.active {
        border-color: #667eea;
        background: #eef2ff;
    }
    .bpsm-font-btn:active {
        transform: scale(0.97);
    }

    /* Preview */
    .bpsm-preview {
        background: #fff;
        border: 2px dashed #e2e8f0;
        border-radius: 10px;
        padding: 20px;
        text-align: center;
        min-height: 70px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    #bpsm-preview-text {
        font-size: 32px;
        color: #1e293b;
        word-break: break-word;
    }

    /* Primary button */
    .bpsm-btn-primary {
        display: block;
        width: 100%;
        padding: 16px;
        margin-top: 20px;
        background: #667eea;
        color: #fff;
        border: none;
        border-radius: 12px;
        font-size: 16px;
        font-weight: 700;
        cursor: pointer;
        transition: all 0.15s;
    }
    .bpsm-btn-primary:disabled {
        background: #cbd5e1;
        cursor: default;
    }
    .bpsm-btn-primary:not(:disabled):active {
        background: #5468d4;
        transform: scale(0.98);
    }

    /* Status */
    .bpsm-status {
        margin-top: 12px;
        padding: 0;
        font-size: 0.85rem;
        text-align: center;
        min-height: 20px;
    }
    .bpsm-status-info { color: #667eea; }
    .bpsm-status-success { color: #059669; font-weight: 600; }
    .bpsm-status-error { color: #dc2626; }

    /* Actions */
    .bpsm-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        padding: 16px 20px;
        border-top: 1px solid #e2e8f0;
        background: #f8fafc;
    }
    .bpsm-btn-secondary,
    .bpsm-btn-success {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 10px 16px;
        border-radius: 8px;
        font-size: 0.85rem;
        font-weight: 600;
        text-decoration: none;
        cursor: pointer;
        border: 1px solid #e2e8f0;
        flex: 1;
        justify-content: center;
    }
    .bpsm-btn-secondary {
        background: #fff;
        color: #1e293b;
    }
    .bpsm-btn-success {
        background: #059669;
        color: #fff;
        border-color: #059669;
    }
    .bpsm-btn-secondary:active {
        background: #f1f5f9;
    }

    /* Terms */
    .bpsm-terms {
        text-align: center;
        padding: 12px 20px 20px;
        background: #f8fafc;
    }
    .bpsm-terms a {
        font-size: 0.8rem;
        color: #667eea;
    }
}
